diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2012-04-24 17:51:36 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2012-04-24 17:51:36 +0000 |
| commit | 46ffdf3bbd65941a229f48a1c441b7ee3f348435 (patch) | |
| tree | 4dea6a5419824f6e6fbe0ef07f6465bd4906fa87 /lib/libc/include | |
| parent | bf270f7c461ae6dc49619915b0f343cfdf99ebad (diff) | |
Notes
Diffstat (limited to 'lib/libc/include')
| -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 d4b24a7c962eb..2182f4689719e 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. * |
