diff options
author | Sebastian Wilhelmi <wilhelmi@ira.uka.de> | 2000-04-19 09:29:19 +0000 |
---|---|---|
committer | Sebastian Wilhelmi <wilhelmi@src.gnome.org> | 2000-04-19 09:29:19 +0000 |
commit | 1383e5b64259c05b977442df2c473fa5931854a5 (patch) | |
tree | dbf95a74fd81c6b14f8686b7cb075f4e197421ea /glib | |
parent | e366512775000ce20eed18ead840de45271c2662 (diff) | |
download | glib-1383e5b64259c05b977442df2c473fa5931854a5.tar.gz |
Made the debugging G_TRYLOCK call also work for compilers with funnt
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work
for compilers with funnt G_STMT_(START|END) macros.
* tests/thread-test.c: Implemented a check for that.
Diffstat (limited to 'glib')
-rw-r--r-- | glib/glib.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/glib/glib.h b/glib/glib.h index 6c13c11b2..49c8fb69e 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -3152,12 +3152,11 @@ extern void glib_dummy_decl (void); #name); \ g_static_mutex_unlock (&G_LOCK_NAME (name)); \ }G_STMT_END -# define G_TRYLOCK(name) G_STMT_START{ \ - g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ +# define G_TRYLOCK(name) \ + (g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ "file %s: line %d (%s): try locking: %s ", \ __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \ - #name); \ - }G_STMT_END, g_static_mutex_trylock (&G_LOCK_NAME (name)) + #name), g_static_mutex_trylock (&G_LOCK_NAME (name))) # else /* !G_DEBUG_LOCKS */ # define G_LOCK(name) g_static_mutex_lock (&G_LOCK_NAME (name)) # define G_UNLOCK(name) g_static_mutex_unlock (&G_LOCK_NAME (name)) |