summaryrefslogtreecommitdiff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorThomas Bushnell, BSG <thomas@gnu.org>1996-09-12 22:22:29 +0000
committerThomas Bushnell, BSG <thomas@gnu.org>1996-09-12 22:22:29 +0000
commitae2ddc98c17c17897398c8d960d984789ecab0d9 (patch)
tree0cc8f727ebaac4445fb9420043c1fcea61c82a24 /sysdeps/mach
parentf33b97f91391579f28d9346967d713345790eaeb (diff)
*** empty log message ***
(vfprintf): Only call __libc_cleanup_region_end if USE_IN_LIBIO, thus matching the sense of the tests around __libc_cleanup_region_start at the front of the function. * stdio-common/vfscanf.c: Include <libc-lock.h>. (UNLOCK_STREAM) [! USE_IN_LIBIO]: Call __libc_cleanup_region_end, not __libc_cleanup_region_start.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/libc-lock.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h
index 2c39592717..ea3d306a52 100644
--- a/sysdeps/mach/libc-lock.h
+++ b/sysdeps/mach/libc-lock.h
@@ -56,5 +56,19 @@ typedef struct __libc_lock_opaque__ __libc_lock_t;
/* Unlock the named lock variable. */
#define __libc_lock_unlock(NAME) __mutex_unlock (&(NAME))
+/* Start a critical region with a cleanup function */
+#define __libc_cleanup_region_start(FCT, ARG) \
+{ \
+ (typeof FCT) __save_FCT = FCT; \
+ (typeof ARG) __save_ARG = ARG; \
+ /* close brace is in __libc_cleanup_region_end below. */
+
+/* End a critical region started with __libc_cleanup_region_start. */
+#define __libc_cleanup_region_end(DOIT) \
+ if (DOIT) \
+ (* __save_FCT)(__save_ARG); \
+}
+
+
#endif /* libc-lock.h */