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:
Patrick Ohly 2013-08-01 16:44:57 +02:00
parent 0a8b3f1f48
commit 193ef1e534

View file

@ -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); \