+1999-07-09 Ulrich Drepper <drepper@cygnus.com>
+
+ * stdio-common/vfprintf.c (buffered_vfprintf): Add locking.
+
1999-07-09 H.J. Lu <hjl@gnu.org>
* Versions.def (GLIBC_2.1.2): Added.
+1999-07-09 Ulrich Drepper <drepper@cygnus.com>
+
+ * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and
+ swap function.
+
1999-07-09 Cristian Gafton <gafton@redhat.com>
* Makefile (libpthread-routines): Add oldsemaphore routine.
static inline int sem_compare_and_swap(old_sem_t *sem, long oldval, long newval)
{
- return __pthread_compare_and_swap(&sem->sem_status, oldval, newval, &sem->sem_spinlock);
+ return compare_and_swap(&sem->sem_status, oldval, newval, &sem->sem_spinlock);
}
/* The state of a semaphore is represented by a long int encoding
symbol_version (__old_sem_getvalue, sem_getvalue, GLIBC_2.0);
symbol_version (__old_sem_destroy, sem_destroy, GLIBC_2.0);
#endif
-
/* Now print to helper instead. */
result = vfprintf (hp, format, args);
+ /* Lock stream. */
+ __libc_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, s);
+ _IO_flockfile (s);
+
/* Now flush anything from the helper to the S. */
#ifdef COMPILE_WPRINTF
if ((to_flush = (hp->_wide_data->_IO_write_ptr
{
if ((int) _IO_sputn (s, hp->_wide_data->_IO_write_base, to_flush)
!= to_flush)
- return -1;
+ result = -1;
}
#else
if ((to_flush = hp->_IO_write_ptr - hp->_IO_write_base) > 0)
{
if ((int) _IO_sputn (s, hp->_IO_write_base, to_flush) != to_flush)
- return -1;
+ result = -1;
}
#endif
+ /* Unlock the stream. */
+ _IO_funlockfile (s);
+ __libc_cleanup_region_end (0);
+
return result;
}