git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14908
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
};
wxSemaphoreInternal::wxSemaphoreInternal( int initialcount, int maxcount )
};
wxSemaphoreInternal::wxSemaphoreInternal( int initialcount, int maxcount )
{
if ( (initialcount < 0) || ((maxcount > 0) && (initialcount > maxcount)) )
{
if ( (initialcount < 0) || ((maxcount > 0) && (initialcount > maxcount)) )
void wxSemaphoreInternal::Wait()
{
void wxSemaphoreInternal::Wait()
{
- wxMutexLocker locker(*m_mutex);
+ wxMutexLocker locker(m_mutex);
bool wxSemaphoreInternal::TryWait()
{
bool wxSemaphoreInternal::TryWait()
{
- wxMutexLocker locker(*m_mutex);
+ wxMutexLocker locker(m_mutex);
if ( count <= 0 )
return FALSE;
if ( count <= 0 )
return FALSE;
bool wxSemaphoreInternal::Wait( unsigned long timeout_millis )
{
bool wxSemaphoreInternal::Wait( unsigned long timeout_millis )
{
- wxMutexLocker locker( *m_mutex );
+ wxMutexLocker locker(m_mutex);
wxLongLong startTime = wxGetLocalTimeMillis();
wxLongLong startTime = wxGetLocalTimeMillis();
if ( remainingTime <= 0 )
return FALSE;
if ( remainingTime <= 0 )
return FALSE;
- bool result = m_cond->Wait( remainingTime );
+ bool result = m_cond.Wait( remainingTime );
if ( !result )
return FALSE;
}
if ( !result )
return FALSE;
}
void wxSemaphoreInternal::Post()
{
void wxSemaphoreInternal::Post()
{
- wxMutexLocker locker(*m_mutex);
+ wxMutexLocker locker(m_mutex);
- if ( (maxcount > 0) && (count == maxcount) )
+ if ( maxcount > 0 && count == maxcount )
{
wxFAIL_MSG( _T("wxSemaphore::Post() overflow") );
}
count++;
{
wxFAIL_MSG( _T("wxSemaphore::Post() overflow") );
}
count++;
}
// --------------------------------------------------------------------------
}
// --------------------------------------------------------------------------