|
Boost Users : |
Subject: Re: [Boost-users] [thread] equivalent of WaitForSingleObject
From: Igor R (boost.lists_at_[hidden])
Date: 2011-02-16 16:00:33
> Iâve got some boost code that calls wait for single object on windows.
>
> Iâd like to transition this to use boost.thread.
>
> What is the best way of doing this, in the while loop Iâm doing:
>
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â while( WaitForSingleObject( hDir, WAIT_TIMEOUT
> ) != WAIT_OBJECT_0 )
What's this object? If it's Windows event, you can re-write your code
to use condition_variable and wait on it. If it's a thread handle, you
wait by using join() member function of te appropriate thread object.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net