Boost logo

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