diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 12 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 12 | ||||
-rw-r--r-- | ace/OS.cpp | 78 | ||||
-rw-r--r-- | ace/OS.h | 26 | ||||
-rw-r--r-- | ace/OS.i | 70 | ||||
-rw-r--r-- | ace/Signal.cpp | 12 | ||||
-rw-r--r-- | ace/Synch.cpp | 2 | ||||
-rw-r--r-- | ace/config-psos-diab-ppc.h | 18 |
9 files changed, 196 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog index 8802cf97441..7f9d9a3059d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Sun Jan 02 00:50:00 2000 Chris Gill <cdgill@cs.wustl.edu> + + * ace/OS.{cpp, h, i} + ace/Signal.cpp + ace/Synch.cpp + ace/config-psos-diab-ppc.h: Added support for native mutexs, + condition variables, and thread-specific storage in pSOS. Native + pSOS mutexes, where available, support several cool features, + including lock recursion and priority inheritance protocol and + priority ceiling protocol support. + Sat Jan 01 09:16:39 2000 David L. Levine <levine@cs.wustl.edu> * ChangeLog,Makefile: moved to ChangeLog-99b. + diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 8802cf97441..7f9d9a3059d 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,15 @@ +Sun Jan 02 00:50:00 2000 Chris Gill <cdgill@cs.wustl.edu> + + * ace/OS.{cpp, h, i} + ace/Signal.cpp + ace/Synch.cpp + ace/config-psos-diab-ppc.h: Added support for native mutexs, + condition variables, and thread-specific storage in pSOS. Native + pSOS mutexes, where available, support several cool features, + including lock recursion and priority inheritance protocol and + priority ceiling protocol support. + Sat Jan 01 09:16:39 2000 David L. Levine <levine@cs.wustl.edu> * ChangeLog,Makefile: moved to ChangeLog-99b. + diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 8802cf97441..7f9d9a3059d 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,15 @@ +Sun Jan 02 00:50:00 2000 Chris Gill <cdgill@cs.wustl.edu> + + * ace/OS.{cpp, h, i} + ace/Signal.cpp + ace/Synch.cpp + ace/config-psos-diab-ppc.h: Added support for native mutexs, + condition variables, and thread-specific storage in pSOS. Native + pSOS mutexes, where available, support several cool features, + including lock recursion and priority inheritance protocol and + priority ceiling protocol support. + Sat Jan 01 09:16:39 2000 David L. Levine <levine@cs.wustl.edu> * ChangeLog,Makefile: moved to ChangeLog-99b. + diff --git a/ace/OS.cpp b/ace/OS.cpp index 0c5da4b59d7..78e8e8b6477 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -1523,7 +1523,7 @@ ACE_OS::sched_params (const ACE_Sched_Params &sched_params, // Note: these three objects require static construction. ACE_thread_t ACE_OS::NULL_thread; ACE_hthread_t ACE_OS::NULL_hthread; -#if defined (ACE_HAS_TSS_EMULATION) +#if defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) ACE_thread_key_t ACE_OS::NULL_key = ACE_static_cast (ACE_thread_key_t, -1); #else /* ! ACE_HAS_TSS_EMULATION */ ACE_thread_key_t ACE_OS::NULL_key; @@ -1544,7 +1544,7 @@ int ACE_OS::socket_initialized_; #endif /* WIN32 */ -#if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) +#if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) // Moved class ACE_TSS_Ref declaration to OS.h so it can be visible to // the single file of template instantiations. @@ -1859,7 +1859,7 @@ ACE_TSS_Cleanup::exit (void * /* status */) // persistant system wide. for (int i = 0; i < index; i++) { -# if defined (ACE_WIN32) +# if defined (ACE_WIN32) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) // Calling thr_keyfree here ensure the key // gets removed appropriately. Notice that // a key should be removed before freeing it. @@ -1904,6 +1904,10 @@ ACE_TSS_Cleanup::free_all_keys_left (void) if (key_arr[i] != ACE_OS::NULL_key) #if defined (ACE_HAS_TSS_EMULATION) ACE_OS::thr_keyfree (key_arr[i]); +#elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + // Don't call ACE_OS::thr_keyfree here. It will try to use + // <in_use_> which has already been cleaned up here. + ::tsd_delete (key_arr[i]); #else /* ACE_WIN32 */ // Don't call ACE_OS::thr_keyfree here. It will try to use // <in_use_> which has already been cleaned up here. @@ -2032,13 +2036,15 @@ ACE_TSS_Cleanup::detach (void *inst) { // Mark the key as no longer being used. key_info->key_in_use (0); -# if defined (ACE_WIN32) +# if defined (ACE_WIN32) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) ACE_thread_key_t temp_key = key_info->key_; # endif /* ACE_WIN32 */ int retv = this->remove (key_info->key_); # if defined (ACE_WIN32) ::TlsFree (temp_key); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + ::tsd_delete (temp_key); # endif /* ACE_WIN32 */ return retv; } @@ -2124,16 +2130,16 @@ ACE_TSS_Emulation::ACE_TSS_DESTRUCTOR ACE_TSS_Emulation::tss_destructor_[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX] = { 0 }; -#if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) +# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) int ACE_TSS_Emulation::key_created_ = 0; ACE_OS_thread_key_t ACE_TSS_Emulation::native_tss_key_; /* static */ -#if defined (ACE_HAS_THR_C_FUNC) +# if defined (ACE_HAS_THR_C_FUNC) extern "C" -#endif /* ACE_HAS_THR_C_FUNC */ +# endif /* ACE_HAS_THR_C_FUNC */ void ACE_TSS_Emulation_cleanup (void *ptr) { @@ -2217,7 +2223,7 @@ ACE_TSS_Emulation::tss_base (void* ts_storage[], u_int *ts_created) return ts_storage ? ts_storage : old_ts_storage; } -#endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE */ +# endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE */ u_int ACE_TSS_Emulation::total_keys () @@ -2240,12 +2246,12 @@ ACE_TSS_Emulation::next_key (ACE_thread_key_t &key) if (total_keys_ < ACE_TSS_THREAD_KEYS_MAX) { -# if defined (ACE_HAS_NONSCALAR_THREAD_KEY_T) +# if defined (ACE_HAS_NONSCALAR_THREAD_KEY_T) ACE_OS::memset (&key, 0, sizeof (ACE_thread_key_t)); ACE_OS::memcpy (&key, &total_keys_, sizeof (u_int)); -# else +# else key = total_keys_; -# endif /* ACE_HAS_NONSCALAR_THREAD_KEY_T */ +# endif /* ACE_HAS_NONSCALAR_THREAD_KEY_T */ ++total_keys_; return 0; @@ -2324,10 +2330,10 @@ ACE_TSS_Emulation::tss_close () void ACE_OS::cleanup_tss (const u_int main_thread) { -#if defined (ACE_HAS_TSS_EMULATION) || defined (ACE_WIN32) +#if defined (ACE_HAS_TSS_EMULATION) || defined (ACE_WIN32) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) // Call TSS destructors for current thread. ACE_TSS_Cleanup::instance ()->exit (0); -#endif /* ACE_HAS_TSS_EMULATION || ACE_WIN32 */ +#endif /* ACE_HAS_TSS_EMULATION || ACE_WIN32 || ACE_PSOS_HAS_TSS */ if (main_thread) { @@ -2339,8 +2345,8 @@ ACE_OS::cleanup_tss (const u_int main_thread) ACE_Log_Msg::close (); #endif /* ! ACE_HAS_TSS_EMULATION && ! ACE_HAS_MINIMAL_ACE_OS */ -#if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) +#if ! defined (ACE_HAS_TSS_EMULATION) // Don't do this with TSS_Emulation, because the the // ACE_TSS_Cleanup::instance () has already exited (). We can't // safely access the TSS values that were created by the main @@ -2348,12 +2354,12 @@ ACE_OS::cleanup_tss (const u_int main_thread) // Remove all TSS_Info table entries. ACE_TSS_Cleanup::instance ()->free_all_keys_left (); -#endif /* ACE_WIN32 */ +#endif /* ! ACE_HAS_TSS_EMULATION */ // Finally, free up the ACE_TSS_Cleanup instance. This method gets // called by the ACE_Object_Manager. delete ACE_TSS_Cleanup::instance (); -#endif /* WIN32 || ACE_HAS_TSS_EMULATION */ +#endif /* WIN32 || ACE_HAS_TSS_EMULATION || ACE_PSOS_HAS_TSS */ #if defined (ACE_HAS_TSS_EMULATION) ACE_TSS_Emulation::tss_close (); @@ -3642,6 +3648,12 @@ ACE_TRACE ("ACE_OS::thr_exit"); # elif defined (ACE_PSOS) ACE_hthread_t tid; ACE_OS::thr_self (tid); + +# if defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + // Call TSS destructors. + ACE_OS::cleanup_tss (0 /* not main thread */); +# endif /* ACE_PSOS && ACE_PSOS_HAS_TSS */ + *((u_long *) status) = ::t_delete (tid); # endif /* ACE_HAS_PTHREADS */ # else @@ -3795,6 +3807,13 @@ ACE_OS::thr_setspecific (ACE_thread_key_t key, void *data) # elif defined (ACE_HAS_STHREADS) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_setspecific (key, data), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + ACE_hthread_t tid; + ACE_OS::thr_self (tid); + if (::tsd_setval (key, tid, data) != 0) + return -1; + ACE_TSS_Cleanup::instance ()->key_used (key); + return 0; # elif defined (ACE_HAS_WTHREADS) ::TlsSetValue (key, data); ACE_TSS_Cleanup::instance ()->key_used (key); @@ -3833,6 +3852,11 @@ ACE_TRACE ("ACE_OS::thr_keyfree"); // the key and destructor. ACE_TSS_Cleanup::instance ()->remove (key); ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::TlsFree (key), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + // Extract out the thread-specific table instance and free up + // the key and destructor. + ACE_TSS_Cleanup::instance ()->remove (key); + return (::tsd_delete (key) == 0) ? 0 : -1; # else ACE_UNUSED_ARG (key); ACE_NOTSUP_RETURN (-1); @@ -3870,7 +3894,6 @@ ACE_OS::thr_keycreate (ACE_OS_thread_key_t *key, ace_result_), int, -1); # endif /* ACE_HAS_STDARG_THR_DEST */ - # elif defined (ACE_HAS_STHREADS) ACE_UNUSED_ARG (inst); ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_keycreate (key, dest), @@ -3943,6 +3966,19 @@ ACE_OS::thr_keycreate (ACE_thread_key_t *key, ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_keycreate (key, dest), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + + static u_long unique_name = 0; + void *tsdanchor; + + ++unique_name; + if (::tsd_create (ACE_reinterpret_cast (char *, unique_name), + 0, TSD_NOALLOC, &tsdanchor, key) != 0) + { + return -1; + } + + return ACE_TSS_Cleanup::instance ()->insert (*key, dest, inst); # elif defined (ACE_HAS_WTHREADS) *key = ::TlsAlloc (); @@ -3972,19 +4008,19 @@ ACE_OS::thr_keycreate (ACE_thread_key_t *key, int ACE_OS::thr_key_used (ACE_thread_key_t key) { -# if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) +# if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) ACE_TSS_Cleanup::instance ()->key_used (key); return 0; # else ACE_UNUSED_ARG (key); ACE_NOTSUP_RETURN (-1); -# endif /* ACE_WIN32 || ACE_HAS_TSS_EMULATION */ +# endif /* ACE_WIN32 || ACE_HAS_TSS_EMULATION || ACE_PSOS_HAS_TSS */ } int ACE_OS::thr_key_detach (void *inst) { -# if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) +# if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) if (ACE_TSS_Cleanup::lockable ()) return ACE_TSS_Cleanup::instance()->detach (inst); else @@ -2320,13 +2320,23 @@ typedef ACE_mutex_t ACE_thread_mutex_t; # elif defined (ACE_PSOS) -// implement ACE_thread_mutex_t and ACE_mutex_t using pSOS semaphores +// Some versions of pSOS provide native mutex support. For others, +// implement ACE_thread_mutex_t and ACE_mutex_t using pSOS semaphores. +// Either way, the types are all u_longs. typedef u_long ACE_mutex_t; typedef u_long ACE_thread_mutex_t; - typedef u_long ACE_thread_t; typedef u_long ACE_hthread_t; +#if defined (ACE_PSOS_HAS_COND_T) +typedef u_long ACE_cond_t; +struct ACE_Export ACE_condattr_t +{ + int type; +}; +#endif + + // TCB registers 0-7 are for application use # define PSOS_TASK_REG_TSS 0 # define PSOS_TASK_REG_MAX 7 @@ -2335,11 +2345,15 @@ typedef u_long ACE_hthread_t; # define PSOS_TASK_MAX_PRIORITY 239 // Key type: the ACE TSS emulation requires the key type be unsigned, -// for efficiency. (Current POSIX and Solaris TSS implementations also -// use unsigned int, so the ACE TSS emulation is compatible with them.) +// for efficiency. Current POSIX and Solaris TSS implementations also +// use unsigned int, so the ACE TSS emulation is compatible with them. +// Native pSOS TSD, where available, uses unsigned long as the key type. +# if defined (ACE_PSOS_HAS_TSS) +typedef u_long ACE_thread_key_t; +# else typedef u_int ACE_thread_key_t; +# endif /* ACE_PSOS_HAS_TSS */ -/* CDG - TBD - revisit these: compare pthreads and pSOS threads */ # define THR_CANCEL_DISABLE 0 /* thread can never be cancelled */ # define THR_CANCEL_ENABLE 0 /* thread can be cancelled */ # define THR_CANCEL_DEFERRED 0 /* cancellation deferred to cancellation point */ @@ -7320,7 +7334,7 @@ private: // moved ACE_TSS_Ref, ACE_TSS_Info, and ACE_TSS_Keys class // declarations from OS.cpp so they are visible to the single // file of template instantiations. -# if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) +# if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) class ACE_TSS_Ref { // = TITLE @@ -1942,10 +1942,45 @@ ACE_OS::mutex_init (ACE_mutex_t *m, ACE_UNUSED_ARG (type); ACE_UNUSED_ARG (arg); ACE_UNUSED_ARG (sa); +# if defined (ACE_PSOS_HAS_MUTEX) + + u_long flags = MU_LOCAL; + u_long ceiling = 0; + +# if defined (ACE_HAS_RECURSIVE_MUTEXES) + flags |= MU_RECURSIVE; +# else /* ! ACE_HAS_RECURSIVE_MUTEXES */ + flags |= MU_NONRECURSIVE; +# endif /* ACE_HAS_RECURSIVE_MUTEXES */ + +# if defined (ACE_PSOS_HAS_PRIO_MUTEX) + + flags |= MU_PRIOR; + +# if defined (ACE_PSOS_HAS_PRIO_INHERIT_MUTEX) + flags |= MU_PRIO_INHERIT; +# elif defined (ACE_PSOS_HAS_PRIO_PROTECT_MUTEX) + ceiling = PSOS_TASK_MAX_PRIORITY; + flags |= MU_PRIO_PROTECT; +# else + flags |= MU_PRIO_NONE; +# endif /* ACE_PSOS_HAS_PRIO_INHERIT_MUTEX */ + +# else /* ! ACE_PSOS_HAS_PRIO_MUTEX */ + + flags |= MU_FIFO | MU_PRIO_NONE; + +# endif + + return (::mu_create (ACE_reinterpret_cast (char *, name), + flags, ceiling, m) == 0) ? 0 : -1; + +# else /* ! ACE_PSOS_HAS_MUTEX */ return ::sm_create ((char *) name, 1, SM_LOCAL | SM_PRIOR, m) == 0 ? 0 : -1; +# endif /* ACE_PSOS_HAS_MUTEX */ # elif defined (VXWORKS) ACE_UNUSED_ARG (name); ACE_UNUSED_ARG (arg); @@ -1992,7 +2027,11 @@ ACE_OS::mutex_destroy (ACE_mutex_t *m) } /* NOTREACHED */ # elif defined (ACE_PSOS) +# if defined (ACE_PSOS_HAS_MUTEX) + return (::mu_delete (*m) == 0) ? 0 : -1; +# else /* ! ACE_PSOS_HAS_MUTEX */ return (::sm_delete (*m) == 0) ? 0 : -1; +# endif /* ACE_PSOS_HAS_MUTEX */ # elif defined (VXWORKS) return ::semDelete (*m) == OK ? 0 : -1; # endif /* Threads variety case */ @@ -2043,7 +2082,11 @@ ACE_OS::mutex_lock (ACE_mutex_t *m) } /* NOTREACHED */ # elif defined (ACE_PSOS) +# if defined (ACE_PSOS_HAS_MUTEX) + return (::mu_lock (*m, MU_WAIT, 0) == 0) ? 0 : -1; +# else /* ACE_PSOS_HAS_MUTEX */ return (::sm_p (*m, SM_WAIT, 0) == 0) ? 0 : -1; +# endif /* ACE_PSOS_HAS_MUTEX */ # elif defined (VXWORKS) return ::semTake (*m, WAIT_FOREVER) == OK ? 0 : -1; # endif /* Threads variety case */ @@ -2143,6 +2186,9 @@ ACE_OS::mutex_trylock (ACE_mutex_t *m) } /* NOTREACHED */ # elif defined (ACE_PSOS) +# if defined (ACE_PSOS_HAS_MUTEX) + return (::mu_lock (*m, MU_NOWAIT, 0) == 0) ? 0 : -1; +# else /* ! ACE_PSOS_HAS_MUTEX */ switch (::sm_p (*m, SM_NOWAIT, 0)) { case 0: @@ -2153,6 +2199,7 @@ ACE_OS::mutex_trylock (ACE_mutex_t *m) default: return -1; } +# endif /* ACE_PSOS_HAS_MUTEX */ # elif defined (VXWORKS) if (::semTake (*m, NO_WAIT) == ERROR) @@ -2244,7 +2291,11 @@ ACE_OS::mutex_unlock (ACE_mutex_t *m) } /* NOTREACHED */ # elif defined (ACE_PSOS) +# if defined (ACE_PSOS_HAS_MUTEX) + return (::mu_unlock (*m) == 0) ? 0 : -1; +# else /* ! ACE_PSOS_HAS_MUTEX */ return (::sm_v (*m) == 0) ? 0 : -1; +# endif /* ACE_PSOS_HAS_MUTEX */ # elif defined (VXWORKS) return ::semGive (*m) == OK ? 0 : -1; # endif /* Threads variety case */ @@ -2391,6 +2442,8 @@ ACE_OS::cond_destroy (ACE_cond_t *cv) # endif /* ACE_HAS_PTHREADS_DRAFT4 || ACE_HAS_PTHREADS_DRAFT6 */ # elif defined (ACE_HAS_STHREADS) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_destroy (cv), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_COND_T) + return (::cv_delete (*cv)) ? 0 : -1; # endif /* ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -2499,6 +2552,13 @@ ACE_OS::cond_init (ACE_cond_t *cv, arg), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_COND_T) +# if defined (ACE_PSOS_HAS_PRIO_MUTEX) + u_long flags = CV_LOCAL | CV_PRIOR; +# else /* ACE_PSOS_HAS_PRIO_MUTEX */ + u_long flags = CV_LOCAL | CV_FIFO; +# endif /* ACE_PSOS_HAS_PRIO_MUTEX */ + return (::cv_create ((char *) name, flags, cv)) ? 0 : -1; # endif /* ACE_HAS_PTHREADS && ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -2536,6 +2596,8 @@ ACE_TRACE ("ACE_OS::cond_signal"); # endif /* ACE_HAS_PTHREADS_DRAFT4 || ACE_HAS_PTHREADS_DRAFT6 */ # elif defined (ACE_HAS_STHREADS) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_signal (cv), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_COND_T) + return (::cv_signal (*cv)) ? 0 : -1; # endif /* ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -2560,6 +2622,8 @@ ACE_TRACE ("ACE_OS::cond_broadcast"); ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_broadcast (cv), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_COND_T) + return (::cv_broadcast (*cv)) ? 0 : -1; # endif /* ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -2583,6 +2647,8 @@ ACE_OS::cond_wait (ACE_cond_t *cv, # elif defined (ACE_HAS_STHREADS) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_wait (cv, external_mutex), ace_result_), int, -1); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_COND_T) + return (::cv_wait (*cv, *external_mutex, 0)) ? 0 : -1; # endif /* ACE_HAS_PTHREADS */ # else ACE_UNUSED_ARG (cv); @@ -6958,6 +7024,10 @@ ACE_OS::thr_getspecific (ACE_OS_thread_key_t key, void **data) #endif /* pthread_getspecific */ # endif /* ACE_HAS_PTHREADS_DRAFT4, 6 */ return 0; +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + ACE_hthread_t tid; + ACE_OS::thr_self (tid); + return (::tsd_getval (key, tid, data) == 0) ? 0 : -1; # elif defined (ACE_HAS_WTHREADS) // The following handling of errno is designed like this due to diff --git a/ace/Signal.cpp b/ace/Signal.cpp index 1b51fd03492..6fbcccb6bd4 100644 --- a/ace/Signal.cpp +++ b/ace/Signal.cpp @@ -374,11 +374,7 @@ ACE_Sig_Handler::remove_handler (int signum, if (ACE_Sig_Handler::in_range (signum)) { -#if defined (ACE_PSOS) - ACE_Sig_Action sa ((ACE_SignalHandler) 0, (sigset_t *) 0); -#else ACE_Sig_Action sa (SIG_DFL, (sigset_t *) 0); // Define the default disposition. -#endif /* defined (ACE_PSOS) */ if (new_disp == 0) new_disp = &sa; @@ -419,11 +415,7 @@ ACE_Sig_Handler::dispatch (int signum, if (eh->handle_signal (signum, siginfo, ucontext) == -1) { // Define the default disposition. -#if defined (ACE_PSOS) - ACE_Sig_Action sa ((ACE_SignalHandler) 0, (sigset_t *) 0); -#else ACE_Sig_Action sa (SIG_DFL, (sigset_t *) 0); -#endif /* defined (ACE_PSOS) */ ACE_Sig_Handler::signal_handlers_[signum] = 0; @@ -748,11 +740,7 @@ ACE_Sig_Handlers::remove_handler (int signum, // register the new disposition or restore the default // disposition. -#if defined (ACE_PSOS) - ACE_Sig_Action sa ((ACE_SignalHandler) 0, (sigset_t *) 0); -#else ACE_Sig_Action sa (SIG_DFL, (sigset_t *) 0); -#endif /* defined (ACE_PSOS) */ if (new_disp == 0) new_disp = &sa; diff --git a/ace/Synch.cpp b/ace/Synch.cpp index 93915f81cba..62de2450ca6 100644 --- a/ace/Synch.cpp +++ b/ace/Synch.cpp @@ -673,7 +673,7 @@ int ACE_Recursive_Thread_Mutex::get_nesting_level (void) { // ACE_TRACE ("ACE_Recursive_Thread_Mutex::get_nesting_level"); -#if defined (ACE_HAS_WINCE) || defined (VXWORKS) +#if defined (ACE_HAS_WINCE) || defined (VXWORKS) || defined (ACE_PSOS) ACE_NOTSUP_RETURN (-1); #elif defined (ACE_HAS_RECURSIVE_MUTEXES) // This is really a Win32-ism... diff --git a/ace/config-psos-diab-ppc.h b/ace/config-psos-diab-ppc.h index ae59200c431..0cdffffe857 100644 --- a/ace/config-psos-diab-ppc.h +++ b/ace/config-psos-diab-ppc.h @@ -112,13 +112,19 @@ # define ACE_MT_SAFE 1 #endif -#define ACE_HAS_TSS_EMULATION - -#define ACE_DEFAULT_THREAD_KEYS 256 - -#define ACE_LACKS_COND_T - // #define ACE_HAS_TSS_EMULATION +// #define ACE_DEFAULT_THREAD_KEYS 256 +#define ACE_HAS_THREAD_SPECIFIC_STORAGE +#define ACE_PSOS_HAS_TSS +#define ACE_DEFAULT_THREAD_KEYS KC_NTSD + +#define ACE_PSOS_HAS_MUTEX +#define ACE_PSOS_HAS_PRIO_MUTEX +#define ACE_PSOS_HAS_PRIO_INHERIT_MUTEX +#define ACE_HAS_RECURSIVE_MUTEXES + +// #define ACE_LACKS_COND_T +#define ACE_PSOS_HAS_COND_T #define ACE_LACKS_PTHREAD_THR_SIGSETMASK |