Hi Ion,
 
I'm on 64-bit Linux (SuSe 10.0) using the Intel compiler 9.0 or gcc 4.0.2.
 
Here is some rough code that may better explain what I'm trying to do:
 

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.

Let me know if I've gone wrong with the pattern I'm using.
 
Cheers,
 
Steve.

 
On 24/05/06, Ion Gaztaņaga <igaztanaga@gmail.com> wrote:
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