Re: mutex problems on Windows

> 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

"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.


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