diff options
Diffstat (limited to 'libc/stdio')
| -rw-r--r-- | libc/stdio/_stdio.c | 31 | ||||
| -rw-r--r-- | libc/stdio/_stdio.h | 8 | ||||
| -rw-r--r-- | libc/stdio/fflush.c | 4 |
3 files changed, 13 insertions, 30 deletions
diff --git a/libc/stdio/_stdio.c b/libc/stdio/_stdio.c index e8206889e..135995298 100644 --- a/libc/stdio/_stdio.c +++ b/libc/stdio/_stdio.c @@ -7,11 +7,7 @@ #include "_stdio.h" -#if defined (__UCLIBC_HAS_THREADS__) && defined (__USE_STDIO_FUTEXES__) -#include <bits/stdio-lock.h> -#endif - -libc_hidden_proto(memcpy) +/* Experimentally off - libc_hidden_proto(memcpy) */ libc_hidden_proto(isatty) /* This is pretty much straight from uClibc, but with one important @@ -163,22 +159,13 @@ FILE *__stdout = _stdio_streams + 1; /* For putchar() macro. */ FILE *_stdio_openlist = _stdio_streams; # ifdef __UCLIBC_HAS_THREADS__ -# ifdef __USE_STDIO_FUTEXES__ -_IO_lock_t _stdio_openlist_add_lock = _IO_lock_initializer; -# else -__UCLIBC_MUTEX_INIT(_stdio_openlist_add_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); -# endif -#ifdef __STDIO_BUFFERS -# ifdef __USE_STDIO_FUTEXES__ -_IO_lock_t _stdio_openlist_del_lock = _IO_lock_initializer; -# else -__UCLIBC_MUTEX_INIT(_stdio_openlist_del_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); -# endif +__UCLIBC_IO_MUTEX_INIT(_stdio_openlist_add_lock); +# ifdef __STDIO_BUFFERS +__UCLIBC_IO_MUTEX_INIT(_stdio_openlist_del_lock); volatile int _stdio_openlist_use_count = 0; int _stdio_openlist_del_count = 0; -#endif +# endif # endif - #endif /**********************************************************************/ #ifdef __UCLIBC_HAS_THREADS__ @@ -213,7 +200,7 @@ void attribute_hidden _stdio_term(void) STDIO_INIT_MUTEX(_stdio_openlist_add_lock); #warning check #ifdef __STDIO_BUFFERS - STDIO_INIT_MUTEX(ptr->__lock); /* Shouldn't be necessary, but... */ + STDIO_INIT_MUTEX(_stdio_openlist_del_lock); #endif /* Next we need to worry about the streams themselves. If a stream @@ -235,11 +222,7 @@ void attribute_hidden _stdio_term(void) } ptr->__user_locking = 1; /* Set locking mode to "by caller". */ -#ifdef __USE_STDIO_FUTEXES__ - _IO_lock_init (ptr->_lock); -#else - __stdio_init_mutex(&ptr->__lock); /* Shouldn't be necessary, but... */ -#endif + STDIO_INIT_MUTEX(ptr->__lock); /* Shouldn't be necessary, but... */ } #endif diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index 27075a8ac..e8ef08983 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -24,18 +24,18 @@ #include <bits/uClibc_mutex.h> #define __STDIO_THREADLOCK_OPENLIST_ADD \ - __UCLIBC_MUTEX_LOCK(_stdio_openlist_add_lock) + __UCLIBC_IO_MUTEX_LOCK(_stdio_openlist_add_lock) #define __STDIO_THREADUNLOCK_OPENLIST_ADD \ - __UCLIBC_MUTEX_UNLOCK(_stdio_openlist_add_lock) + __UCLIBC_IO_MUTEX_UNLOCK(_stdio_openlist_add_lock) #ifdef __STDIO_BUFFERS #define __STDIO_THREADLOCK_OPENLIST_DEL \ - __UCLIBC_MUTEX_LOCK(_stdio_openlist_del_lock) + __UCLIBC_IO_MUTEX_LOCK(_stdio_openlist_del_lock) #define __STDIO_THREADUNLOCK_OPENLIST_DEL \ - __UCLIBC_MUTEX_UNLOCK(_stdio_openlist_del_lock) + __UCLIBC_IO_MUTEX_UNLOCK(_stdio_openlist_del_lock) #ifdef __UCLIBC_HAS_THREADS__ diff --git a/libc/stdio/fflush.c b/libc/stdio/fflush.c index e1527b3a3..11b837dde 100644 --- a/libc/stdio/fflush.c +++ b/libc/stdio/fflush.c @@ -19,11 +19,11 @@ libc_hidden_proto(fflush_unlocked) * when all (lbf) writing streams are flushed. */ #define __MY_STDIO_THREADLOCK(__stream) \ - __UCLIBC_MUTEX_CONDITIONAL_LOCK((__stream)->__lock, \ + __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK((__stream)->__lock, \ (_stdio_user_locking != 2)) #define __MY_STDIO_THREADUNLOCK(__stream) \ - __UCLIBC_MUTEX_CONDITIONAL_UNLOCK((__stream)->__lock, \ + __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK((__stream)->__lock, \ (_stdio_user_locking != 2)) #if defined(__UCLIBC_HAS_THREADS__) && defined(__STDIO_BUFFERS) |
