本文整理汇总了C++中wxSemaphore::Post方法的典型用法代码示例。如果您正苦于以下问题:C++ wxSemaphore::Post方法的具体用法?C++ wxSemaphore::Post怎么用?C++ wxSemaphore::Post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxSemaphore
的用法示例。
在下文中一共展示了wxSemaphore::Post方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Resume
void wxThreadInternal::Resume()
{
wxCHECK_RET( m_state == STATE_PAUSED,
wxT("can't resume thread which is not suspended.") );
// the thread might be not actually paused yet - if there were no call to
// TestDestroy() since the last call to Pause() for example
if ( IsReallyPaused() )
{
wxLogTrace(TRACE_THREADS,
_T("Waking up thread %ld"), THR_ID(this));
// wake up Pause()
m_semSuspend.Post();
// reset the flag
SetReallyPaused(false);
}
else
{
wxLogTrace(TRACE_THREADS,
_T("Thread %ld is not yet really paused"), THR_ID(this));
}
SetState(STATE_RUNNING);
}
示例2: OnExit
void MyDetachedThread::OnExit()
{
//wxLogTrace(wxT("thread"), wxT("Thread %ld is in OnExit"), GetId());
wxCriticalSectionLocker lock(gs_critsect);
if ( !--gs_counter && !m_cancelled )
gs_cond.Post();
}
示例3: Broadcast
wxCondError wxConditionInternal::Broadcast()
{
wxCriticalSectionLocker lock(m_csWaiters);
while ( m_numWaiters > 0 )
{
if ( m_semaphore.Post() != wxSEMA_NO_ERROR )
return wxCOND_MISC_ERROR;
m_numWaiters--;
}
return wxCOND_NO_ERROR;
}
示例4: Entry
virtual ExitCode Entry()
{
//wxPrintf(wxT("Thread %lu has started running.\n"), GetId());
gs_cond.Post();
//wxPrintf(wxT("Thread %lu starts to wait...\n"), GetId());
m_mutex->Lock();
m_condition->Wait();
m_mutex->Unlock();
//wxPrintf(wxT("Thread %lu finished to wait, exiting.\n"), GetId());
return 0;
}
示例5: Signal
wxCondError wxConditionInternal::Signal()
{
wxCriticalSectionLocker lock(m_csWaiters);
if ( m_numWaiters > 0 )
{
// increment the semaphore by 1
if ( m_semaphore.Post() != wxSEMA_NO_ERROR )
return wxCOND_MISC_ERROR;
m_numWaiters--;
}
return wxCOND_NO_ERROR;
}
示例6: Resume
void wxThreadInternal::Resume()
{
wxCHECK_RET( m_state == STATE_PAUSED,
wxT("can't resume thread which is not suspended.") );
// the thread might be not actually paused yet - if there were no call to
// TestDestroy() since the last call to Pause() for example
if ( IsReallyPaused() )
{
// wake up Pause()
m_semSuspend.Post();
// reset the flag
SetReallyPaused( false );
}
SetState( STATE_RUNNING );
}
示例7: Broadcast
wxCondError wxConditionInternal::Broadcast()
{
wxCriticalSectionLocker lock(m_csWaiters);
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
while ( m_numWaiters > 0 )
{
if ( m_semaphore.Post() != wxSEMA_NO_ERROR )
return wxCOND_MISC_ERROR;
m_numWaiters--;
}
return wxCOND_NO_ERROR;
}