PTHREAD_ONCE_INIT only needs to be a valid initializer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36066 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+1
-2
@@ -26,7 +26,7 @@
|
|||||||
#include "posixtest.h"
|
#include "posixtest.h"
|
||||||
|
|
||||||
/* Global pthread_once_t object */
|
/* Global pthread_once_t object */
|
||||||
pthread_once_t once_control;
|
pthread_once_t once_control = PTHREAD_ONCE_INIT;
|
||||||
|
|
||||||
/* Keeps track of how many times the init function has been called. */
|
/* Keeps track of how many times the init function has been called. */
|
||||||
int init_flag;
|
int init_flag;
|
||||||
@@ -68,7 +68,6 @@ void *an_init_func2()
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
pthread_t new_th;
|
pthread_t new_th;
|
||||||
once_control = PTHREAD_ONCE_INIT;
|
|
||||||
init_flag=0;
|
init_flag=0;
|
||||||
|
|
||||||
/* Create a thread that will execute the first call to pthread_once() */
|
/* Create a thread that will execute the first call to pthread_once() */
|
||||||
|
|||||||
+1
-2
@@ -181,7 +181,7 @@ void initializer( void )
|
|||||||
void * test( void * arg )
|
void * test( void * arg )
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
pthread_once_t once_ctl;
|
pthread_once_t once_ctl = PTHREAD_ONCE_INIT;
|
||||||
|
|
||||||
/* We don't block the signals SIGUSR1 and SIGUSR2 for this THREAD */
|
/* We don't block the signals SIGUSR1 and SIGUSR2 for this THREAD */
|
||||||
ret = pthread_sigmask( SIG_UNBLOCK, &usersigs, NULL );
|
ret = pthread_sigmask( SIG_UNBLOCK, &usersigs, NULL );
|
||||||
@@ -196,7 +196,6 @@ void * test( void * arg )
|
|||||||
{
|
{
|
||||||
count_ope++;
|
count_ope++;
|
||||||
|
|
||||||
once_ctl = PTHREAD_ONCE_INIT;
|
|
||||||
init_ctl = 0;
|
init_ctl = 0;
|
||||||
|
|
||||||
ret = pthread_once( &once_ctl, initializer );
|
ret = pthread_once( &once_ctl, initializer );
|
||||||
|
|||||||
Reference in New Issue
Block a user