mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-09-20 09:16:15 +02:00
Also use trylock in the bitlock tests
This commit is contained in:
parent
ce7463a87b
commit
9174569736
@ -57,7 +57,13 @@ acquire (int nr)
|
|||||||
|
|
||||||
self = g_thread_self ();
|
self = g_thread_self ();
|
||||||
|
|
||||||
g_bit_lock (&locks[nr], bits[nr]);
|
if (!g_bit_trylock (&locks[nr], bits[nr]))
|
||||||
|
{
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("thread %p going to block on lock %d\n", self, nr);
|
||||||
|
g_bit_lock (&locks[nr], bits[nr]);
|
||||||
|
}
|
||||||
|
|
||||||
g_assert (owners[nr] == NULL); /* hopefully nobody else is here */
|
g_assert (owners[nr] == NULL); /* hopefully nobody else is here */
|
||||||
owners[nr] = self;
|
owners[nr] = self;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user