2005-02-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/findfp.c (__sinit): Protect with new lock. (__sinit_lock): New lock. (__sinit_lock_acquire, __sinit_lock_release): New functions. * libc/stdio/local.h: Add reference to new __sinit locking functions.
This commit is contained in:
parent
b59cab1e2e
commit
3d91567088
@ -1,3 +1,11 @@
|
||||
2005-02-07 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* libc/stdio/findfp.c (__sinit): Protect with new lock.
|
||||
(__sinit_lock): New lock.
|
||||
(__sinit_lock_acquire, __sinit_lock_release): New functions.
|
||||
* libc/stdio/local.h: Add reference to new __sinit locking
|
||||
functions.
|
||||
|
||||
2005-02-07 Jeff Johnston <jjohnstn@redhat.com>
|
||||
|
||||
* libc/include/math.h (isfinite, isnormal, isunordered): Change
|
||||
|
@ -163,6 +163,14 @@ _VOID
|
||||
_DEFUN(__sinit, (s),
|
||||
struct _reent *s)
|
||||
{
|
||||
__sinit_lock_acquire ();
|
||||
|
||||
if (s->__sdidinit)
|
||||
{
|
||||
__sinit_lock_release ();
|
||||
return;
|
||||
}
|
||||
|
||||
/* make sure we clean up on exit */
|
||||
s->__cleanup = _cleanup_r; /* conservative */
|
||||
s->__sdidinit = 1;
|
||||
@ -192,11 +200,13 @@ _DEFUN(__sinit, (s),
|
||||
|
||||
std (s->_stderr, __SWR | __SNBF, 2, s);
|
||||
|
||||
__sinit_lock_release ();
|
||||
}
|
||||
|
||||
#ifndef __SINGLE_THREAD__
|
||||
|
||||
__LOCK_INIT_RECURSIVE(static, __sfp_lock);
|
||||
__LOCK_INIT_RECURSIVE(static, __sinit_lock);
|
||||
|
||||
_VOID
|
||||
_DEFUN_VOID(__sfp_lock_acquire)
|
||||
@ -210,6 +220,18 @@ _DEFUN_VOID(__sfp_lock_release)
|
||||
__lock_release_recursive (__sfp_lock);
|
||||
}
|
||||
|
||||
_VOID
|
||||
_DEFUN_VOID(__sinit_lock_acquire)
|
||||
{
|
||||
__lock_acquire_recursive (__sinit_lock);
|
||||
}
|
||||
|
||||
_VOID
|
||||
_DEFUN_VOID(__sinit_lock_release)
|
||||
{
|
||||
__lock_release_recursive (__sinit_lock);
|
||||
}
|
||||
|
||||
/* Walkable file locking routine. */
|
||||
static int
|
||||
_DEFUN(__fp_lock, (ptr),
|
||||
|
@ -95,7 +95,11 @@ char *_EXFUN(_llicvt,(char *, long long, char));
|
||||
#ifdef __SINGLE_THREAD__
|
||||
#define __sfp_lock_acquire()
|
||||
#define __sfp_lock_release()
|
||||
#define __sinit_lock_acquire()
|
||||
#define __sinit_lock_release()
|
||||
#else
|
||||
_VOID _EXFUN(__sfp_lock_acquire,(_VOID));
|
||||
_VOID _EXFUN(__sfp_lock_release,(_VOID));
|
||||
_VOID _EXFUN(__sinit_lock_acquire,(_VOID));
|
||||
_VOID _EXFUN(__sinit_lock_release,(_VOID));
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user