123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
- ((_name) = (_IO_lock_t) _IO_lock_initializer , 0)
- ((void) 0)
- do { \
- void *__self = THREAD_SELF; \
- if ((_name).owner != __self) \
- { \
- lll_lock ((_name).lock, LLL_PRIVATE); \
- (_name).owner = __self; \
- } \
- ++(_name).cnt; \
- } while (0)
- ({ \
- int __result = 0; \
- void *__self = THREAD_SELF; \
- if ((_name).owner != __self) \
- { \
- if (lll_trylock ((_name).lock) == 0) \
- { \
- (_name).owner = __self; \
- (_name).cnt = 1; \
- } \
- else \
- __result = EBUSY; \
- } \
- else \
- ++(_name).cnt; \
- __result; \
- })
- do { \
- if (--(_name).cnt == 0) \
- { \
- (_name).owner = NULL; \
- lll_unlock ((_name).lock, LLL_PRIVATE); \
- } \
- } while (0)
- __libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp)
- #define _IO_cleanup_region_start_noarg(_fct) \
- __libc_cleanup_region_start (1, _fct, NULL)
- #define _IO_cleanup_region_end(_doit) \
- __libc_cleanup_region_end (_doit)
- #if defined _LIBC && !defined NOT_IN_libc
- # ifdef __EXCEPTIONS
- # define _IO_acquire_lock(_fp) \
- do { \
- _IO_FILE *_IO_acquire_lock_file \
- __attribute__((cleanup (_IO_acquire_lock_fct))) \
- = (_fp); \
- _IO_flockfile (_IO_acquire_lock_file);
- # define _IO_acquire_lock_clear_flags2(_fp) \
- do { \
- _IO_FILE *_IO_acquire_lock_file \
- __attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct))) \
- = (_fp); \
- _IO_flockfile (_IO_acquire_lock_file);
- # else
- # define _IO_acquire_lock(_fp) _IO_acquire_lock_needs_exceptions_enabled
- # define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
- # endif
- # define _IO_release_lock(_fp) ; } while (0)
- #endif
- #endif /* bits/stdio-lock.h */
|