Re: GModule build fixes



> >         * thread-test fix to use g_thread_yield() to yield, rather than
> >           g_usleep
> 
> Can you explain this one a bit more?

g_usleep "pauses the program for the given number of microseconds".
g_thread_yield "give[s] way to other threads waiting to be scheduled".
All of the cases in thread-test that use g_usleep are using it to let
other threads get processor time, which I'm guessing works on Linux
because of the way that threads are just processes. But in general,
g_usleep() is going to pause the whole program, and so thread-test.c on
my machine almost always died with:

(process:15561): ** ERROR **: file thread-test.c: line 13
(test_g_mutex_thread): assertion failed: (g_mutex_trylock
(test_g_mutex_mutex) == FALSE)
aborting...

(occasionally it would make it beyond that but die in the static mutex
test).

-- Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]