2001-08-24 11:20:56 +08:00
|
|
|
/* Thread package specific definitions of stream lock type. Generic version.
|
2001-07-24 09:33:57 +08:00
|
|
|
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
2000-03-10 16:46:33 +08:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 12:58:11 +08:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2000-03-10 16:46:33 +08:00
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 12:58:11 +08:00
|
|
|
Lesser General Public License for more details.
|
2000-03-10 16:46:33 +08:00
|
|
|
|
2001-07-06 12:58:11 +08:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
02111-1307 USA. */
|
2000-03-10 16:46:33 +08:00
|
|
|
|
|
|
|
#ifndef _BITS_STDIO_LOCK_H
|
|
|
|
#define _BITS_STDIO_LOCK_H 1
|
|
|
|
|
|
|
|
#include <bits/libc-lock.h>
|
|
|
|
|
2001-08-23 14:03:42 +08:00
|
|
|
__libc_lock_define_recursive (typedef, _IO_lock_t)
|
2000-03-10 16:46:33 +08:00
|
|
|
|
|
|
|
/* We need recursive (counting) mutexes. */
|
2001-08-24 11:20:56 +08:00
|
|
|
#ifdef _LIBC_LOCK_RECURSIVE_INITIALIZER
|
|
|
|
# define _IO_lock_initializer _LIBC_LOCK_RECURSIVE_INITIALIZER
|
|
|
|
#elif _IO_MTSAFE_IO
|
|
|
|
#error libio needs recursive mutexes for _IO_MTSAFE_IO
|
|
|
|
#endif
|
2000-03-10 16:46:33 +08:00
|
|
|
|
2001-08-23 14:03:42 +08:00
|
|
|
#define _IO_lock_init(_name) __libc_lock_init_recursive (_name)
|
|
|
|
#define _IO_lock_fini(_name) __libc_lock_fini_recursive (_name)
|
|
|
|
#define _IO_lock_lock(_name) __libc_lock_lock_recursive (_name)
|
|
|
|
#define _IO_lock_unlock(_name) __libc_lock_unlock_recursive (_name)
|
|
|
|
|
2000-03-10 16:46:33 +08:00
|
|
|
|
|
|
|
#define _IO_cleanup_region_start(_fct, _fp) \
|
2001-08-24 11:20:56 +08:00
|
|
|
__libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp)
|
2001-07-24 09:33:57 +08:00
|
|
|
#define _IO_cleanup_region_start_noarg(_fct) \
|
2001-08-24 11:20:56 +08:00
|
|
|
__libc_cleanup_region_start (1, _fct, NULL)
|
2000-03-10 16:46:33 +08:00
|
|
|
#define _IO_cleanup_region_end(_doit) \
|
2001-08-24 11:20:56 +08:00
|
|
|
__libc_cleanup_region_end (_doit)
|
2000-03-10 16:46:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* bits/stdio-lock.h */
|