glib: SYNCEVO_GLIB_CALL_SYNC() must use GRunWhile()
Like everything else that waits for a certain event on the main loop, SYNCEVO_GLIB_CALL_SYNC() should also better use GRunWhile(). This is necessary to be usable in threads.
This commit is contained in:
parent
0a8b3f1f48
commit
193ef1e534
1 changed files with 2 additions and 3 deletions
|
@ -42,6 +42,7 @@ typedef void *GMainLoop;
|
|||
#include <boost/type_traits/remove_pointer.hpp>
|
||||
#include <boost/type_traits/function_traits.hpp>
|
||||
#include <boost/utility/value_init.hpp>
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
@ -1033,9 +1034,7 @@ template<> class GAsyncReadyDoneCXX<void>
|
|||
SYNCEVO_GLIB_CALL_ASYNC(_prepare, \
|
||||
GAsyncReadyDoneCXX<boost::function<typeof(_prepare ## _finish)>::result_type>::createCB(_res, _gerror, done), \
|
||||
_args); \
|
||||
while (!done) { \
|
||||
g_main_context_iteration(NULL, true); \
|
||||
} \
|
||||
GRunWhile(! boost::lambda::var(done)); \
|
||||
} while (false); \
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue