diff options
Diffstat (limited to 'lib/libc/include/libc_private.h')
-rw-r--r-- | lib/libc/include/libc_private.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index d4b24a7..2182f46 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -81,6 +81,19 @@ void _rtld_error(const char *fmt, ...); #define FLOCKFILE(fp) if (__isthreaded) _FLOCKFILE(fp) #define FUNLOCKFILE(fp) if (__isthreaded) _funlockfile(fp) +struct _spinlock; +extern struct _spinlock __stdio_thread_lock; +#define STDIO_THREAD_LOCK() \ +do { \ + if (__isthreaded) \ + _SPINLOCK(&__stdio_thread_lock); \ +} while (0) +#define STDIO_THREAD_UNLOCK() \ +do { \ + if (__isthreaded) \ + _SPINUNLOCK(&__stdio_thread_lock); \ +} while (0) + /* * Indexes into the pthread jump table. * |