Re: mutex problems on Windows
- From: Tor Lillqvist <tml iki fi>
- To: Dov Grobgeld <dov grobgeld gmail com>
- Cc: Gnome List <gtk-list gnome org>
- Subject: Re: mutex problems on Windows
- Date: Mon, 6 Jul 2009 18:22:16 +0300
> W locks j->M through g_mutex_lock(j->M) so that a subsequent lock will
> block.
> W blocks on M through a second call to g_mutex_lock(j->M)
I.e. a thread calls g_mutex_lock() on a mutex that it already has
locked. This is explicitly documented as undefined behaviour. See
http://library.gnome.org/devel/glib/stable/glib-Threads.html#g-mutex-lock
:
"GMutex is neither guaranteed to be recursive nor to be non-recursive,
i.e. the return value of g_mutex_trylock() could be both FALSE or
TRUE, if the current thread already has locked mutex. Use
GStaticRecMutex, if you need recursive mutexes."
> Is something supposed to be different under Windows, or should I file a bug?
It is supposed to be potentially different on different platforms, yes.
--tml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]