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
(parent:
823e326
)
Improve testcoverage in the rec-mutex test
author
Matthias Clasen
<mclasen@redhat.com>
Tue, 4 Oct 2011 04:44:58 +0000
(
00:44
-0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Tue, 4 Oct 2011 04:44:58 +0000
(
00:44
-0400)
Test g_rec_mutex_trylock() in both locked and unlocked cases.
glib/tests/rec-mutex.c
patch
|
blob
|
history
diff --git
a/glib/tests/rec-mutex.c
b/glib/tests/rec-mutex.c
index
c8d5a35
..
5f3abcc
100644
(file)
--- a/
glib/tests/rec-mutex.c
+++ b/
glib/tests/rec-mutex.c
@@
-77,13
+77,13
@@
acquire (gint nr)
self = g_thread_self ();
- if (
owners[nr] != NULL && owners[nr] != self
)
+ if (
!g_rec_mutex_trylock (&locks[nr])
)
{
if (g_test_verbose ())
g_print ("thread %p going to block on lock %d\n", self, nr);
- }
- g_rec_mutex_lock (&locks[nr]);
+ g_rec_mutex_lock (&locks[nr]);
+ }
g_assert (owners[nr] == NULL); /* hopefully nobody else is here */
owners[nr] = self;