summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>2000-04-19 09:29:19 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2000-04-19 09:29:19 +0000
commit1383e5b64259c05b977442df2c473fa5931854a5 (patch)
treedbf95a74fd81c6b14f8686b7cb075f4e197421ea /glib
parente366512775000ce20eed18ead840de45271c2662 (diff)
downloadglib-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.h7
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))