int Fun1( bufferIndex, expectedProgressState, newProgressState, timeoutTime)
{
boost::shmem::shared_timed_mutex::scoped_timed_lock lock( mutex, timeoutTime)
if (lock.locked() == true)
{
while ( mp_bufferIndex[bufferIndex].m_progressState != expectedProgressState)
{
if ( mp_bufferIndex[bufferIndex].m_bufferCondition.timed_wait( lock, timeoutTime) == false)
{
// Timed out on condition
return timedOut;
}
}
// Change the progress state
{
else
{
// mutex timed out
return timedOut;
}
return success;
}
I hope this makes sense. In this test, the value of the expectedProgressState is never true, in order to force the timeout. Basically I obtain the mutex before we even wait on the condition variable.
Hi Steve,
Can you give me some more information about this? Platform, OS,
compiler... If you could do a small test case it would be even better.
Regards,
Ion
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users