projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ce7463a
)
Also use trylock in the bitlock tests
author
Matthias Clasen
<mclasen@redhat.com>
Sat, 31 Jul 2010 06:40:16 +0000
(
02:40
-0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Sat, 31 Jul 2010 06:40:16 +0000
(
02:40
-0400)
gthread/tests/1bit-mutex.c
patch
|
blob
|
history
diff --git
a/gthread/tests/1bit-mutex.c
b/gthread/tests/1bit-mutex.c
index
abb6ddf
..
6c5d0cd
100644
(file)
--- a/
gthread/tests/1bit-mutex.c
+++ b/
gthread/tests/1bit-mutex.c
@@
-57,7
+57,13
@@
acquire (int nr)
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 */
owners[nr] = self;