diff options
author | Steve Huston <shuston@riverace.com> | 1998-04-15 01:29:31 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 1998-04-15 01:29:31 +0000 |
commit | 14b01a5047f8b6fe6f04f3e7c84bc9ed494240d8 (patch) | |
tree | ad1b22686096f52b88eab3c42f6e2a1e91d6ecfc | |
parent | 50b2cb259685ef0cd707adaa48ffa6786b68f77c (diff) | |
download | ATCD-14b01a5047f8b6fe6f04f3e7c84bc9ed494240d8.tar.gz |
Added sections for handling 1003.1c pthreads in mutex_init and cond_init.
-rw-r--r-- | ace/OS.i | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1493,6 +1493,9 @@ ACE_OS::mutex_init (ACE_mutex_t *m, && ::pthread_mutexattr_setkind_np (&attributes, type) == 0 #endif /* ACE_HAS_DCETHREADS */ && ::pthread_mutex_init (m, attributes) == 0) +#elif defined (ACE_HAS_PTHREADS_1003_DOT_1C) || defined (AIX) + if (ACE_ADAPT_RETVAL(::pthread_mutexattr_init (&attributes), result) == 0 + && ACE_ADAPT_RETVAL(::pthread_mutex_init (m, &attributes), result)== 0) #else if (::pthread_mutexattr_init (&attributes) == 0 #if defined (ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP) @@ -1501,6 +1504,8 @@ ACE_OS::mutex_init (ACE_mutex_t *m, && ::pthread_mutex_init (m, &attributes) == 0) #endif /* ACE_HAS_DCETHREADS */ result = 0; + else + result = -1; // ACE_ADAPT_RETVAL used it for intermediate status #if !defined (ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP) ACE_UNUSED_ARG (type); @@ -1984,6 +1989,9 @@ ACE_OS::cond_init (ACE_cond_t *cv, int type, LPCTSTR name, void *arg) #if defined (ACE_HAS_DCETHREADS) if (::pthread_condattr_create (&attributes) == 0 && ::pthread_cond_init (cv, attributes) == 0 +#elif defined (ACE_HAS_PTHREADS_1003_DOT_1C) || defined (AIX) + if (ACE_ADAPT_RETVAL(::pthread_condattr_init (&attributes), result) == 0 + && ACE_ADAPT_RETVAL(::pthread_cond_init (cv, &attributes), result) == 0 #else if (::pthread_condattr_init (&attributes) == 0 && ::pthread_cond_init (cv, &attributes) == 0 @@ -1992,11 +2000,13 @@ ACE_OS::cond_init (ACE_cond_t *cv, int type, LPCTSTR name, void *arg) # endif /* ACE_HAS_PTHREAD_CONDATTR_SETKIND_NP */ #endif /* ACE_HAS_DCETHREADS */ #if !defined (ACE_LACKS_CONDATTR_PSHARED) - && ::pthread_condattr_setpshared (&attributes, type) == 0 + && ACE_ADAPT_RETVAL(::pthread_condattr_setpshared (&attributes, type), + result) == 0 #endif /* ACE_LACKS_CONDATTR_PSHARED */ ) - result = 0; - + result = 0; + else + result = -1; // ACE_ADAPT_RETVAL used it for intermediate status #if defined (ACE_HAS_DCETHREADS) ::pthread_condattr_delete (&attributes); #else |