From 8e69b283a4c057187203f08a76807e46f01332ae Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 7 Apr 2010 18:18:11 +0000 Subject: [PATCH] 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 --- .../posixtestsuite/conformance/interfaces/pthread_once/3-1.c | 3 +-- .../posixtestsuite/conformance/interfaces/pthread_once/6-1.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c index f1ceb9e19f..634132460b 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/3-1.c @@ -26,7 +26,7 @@ #include "posixtest.h" /* 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. */ int init_flag; @@ -68,7 +68,6 @@ void *an_init_func2() int main() { pthread_t new_th; - once_control = PTHREAD_ONCE_INIT; init_flag=0; /* Create a thread that will execute the first call to pthread_once() */ diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c index 221ba6a665..11585d6c93 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/6-1.c @@ -181,7 +181,7 @@ void initializer( void ) void * test( void * arg ) { 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 */ ret = pthread_sigmask( SIG_UNBLOCK, &usersigs, NULL ); @@ -196,7 +196,6 @@ void * test( void * arg ) { count_ope++; - once_ctl = PTHREAD_ONCE_INIT; init_ctl = 0; ret = pthread_once( &once_ctl, initializer );