Revert the previous change to pthread_once() stub in libc. It is actually

a feature that libstdc++ depends on to simulate the behavior of libc's
internal '__isthreaded' variable.  One benefit of this is that _libc_once()
is now private to _once_stub.c.

Requested by:	kan
This commit is contained in:
John Baldwin 2009-11-20 20:43:34 +00:00
parent ed848e3a02
commit 4e1fc19cea
3 changed files with 3 additions and 7 deletions

View File

@ -33,11 +33,8 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
#include "libc_private.h"
/*
* This implements pthread_once() for the single-threaded case. It is
* non-static so that it can be used by _pthread_stubs.c.
*/
int
/* This implements pthread_once() for the single-threaded case. */
static int
_libc_once(pthread_once_t *once_control, void (*init_routine)(void))
{

View File

@ -105,7 +105,7 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = {
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_LOCK */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_TRYLOCK */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_UNLOCK */
{PJT_DUAL_ENTRY(_libc_once)}, /* PJT_ONCE */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ONCE */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_DESTROY */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_INIT */
{PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_RDLOCK */

View File

@ -152,7 +152,6 @@ void _init_tls(void);
* and multi-threaded applications.
*/
int _once(pthread_once_t *, void (*)(void));
int _libc_once(pthread_once_t *, void (*)(void));
/*
* Set the TLS thread pointer