diff options
author | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-26 08:57:38 +0000 |
---|---|---|
committer | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-10-26 08:57:38 +0000 |
commit | 9405555e1af0935c6e7c53fb0b7f45aa9418f4de (patch) | |
tree | ea566b56d69ce1a0a897c801e2e04e1134a4392c | |
parent | de0bc1f3d6d816e85d68b0dc29e8c2211a5fb692 (diff) | |
download | ATCD-9405555e1af0935c6e7c53fb0b7f45aa9418f4de.tar.gz |
Thu Oct 26 04:00:00 2000 Luther J Baker <luther@cs.wustl.edu>
-rw-r--r-- | ace/OS.cpp | 34 | ||||
-rw-r--r-- | ace/OS.h | 8 | ||||
-rw-r--r-- | ace/OS.i | 23 | ||||
-rw-r--r-- | ace/OS_Dirent.inl | 10 |
4 files changed, 64 insertions, 11 deletions
diff --git a/ace/OS.cpp b/ace/OS.cpp index 817620a482b..da6d73c4560 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -2452,7 +2452,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func, # define ACE_THREAD_ARGUMENT thread_args # endif /* ! defined (ACE_NO_THREAD_ADAPTER) */ -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) ACE_Base_Thread_Adapter *thread_args; if (thread_adapter == 0) { @@ -3780,6 +3780,7 @@ ACE_OS::thr_setspecific (ACE_thread_key_t key, void *data) // If we are using TSS emulation then we shuld use ACE's implementation // of it and not make any PACE calls. #if defined (ACE_HAS_PACE) && !defined (ACE_HAS_TSS_EMULATION) + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_setspecific (key, data), ace_result_), int, -1); @@ -3959,8 +3960,9 @@ ACE_OS::thr_keycreate (ACE_thread_key_t *key, // ACE_OS_TRACE ("ACE_OS::thr_keycreate"); // If we are using TSS emulation then we shuld use ACE's implementation // of it and not make any PACE calls. -#if defined (ACE_HAS_PACE) && !defined (ACE_HAS_TSS_EMULATION) +#if defined (ACE_HAS_PACE) && !defined (ACE_HAS_TSS_EMULATION) && !defined (ACE_WIN32) ACE_UNUSED_ARG (inst); + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_key_create (key, dest), ace_result_), int, -1); @@ -4729,6 +4731,7 @@ spa (FUNCPTR entry, ...) # endif /* VXWORKS */ # if !defined (ACE_HAS_SIGINFO_T) +# if !defined (ACE_HAS_PACE) || !defined (ACE_WIN32) siginfo_t::siginfo_t (ACE_HANDLE handle) : si_handle_ (handle), si_handles_ (&handle) @@ -4740,6 +4743,7 @@ siginfo_t::siginfo_t (ACE_HANDLE *handles) si_handles_ (handles) { } +# endif /* ! (ACE_HAS_PACE && ACE_WIN32) */ # endif /* ACE_HAS_SIGINFO_T */ pid_t @@ -5818,10 +5822,17 @@ ACE_OS::cond_wait (ACE_cond_t *cv, # if defined (ACE_HAS_SIGNAL_OBJECT_AND_WAIT) if (external_mutex->type_ == USYNC_PROCESS) // This call will automatically release the mutex and wait on the semaphore. +# if defined (ACE_HAS_PACE) + ACE_WIN32CALL (ACE_ADAPT_RETVAL (::SignalObjectAndWait (external_mutex->proc_mutex_, + cv->sema_.sema_, INFINITE, FALSE), + result), + int, -1, result); +# else ACE_WIN32CALL (ACE_ADAPT_RETVAL (::SignalObjectAndWait (external_mutex->proc_mutex_, cv->sema_, INFINITE, FALSE), result), int, -1, result); +# endif /* ACE_HAS_PACE */ else # endif /* ACE_HAS_SIGNAL_OBJECT_AND_WAIT */ { @@ -5938,10 +5949,17 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, if (external_mutex->type_ == USYNC_PROCESS) // This call will automatically release the mutex and wait on the // semaphore. +# if defined (ACE_HAS_PACE) + result = ::SignalObjectAndWait (external_mutex->proc_mutex_, + cv->sema_.sema_, + msec_timeout, + FALSE); +# else result = ::SignalObjectAndWait (external_mutex->proc_mutex_, cv->sema_, msec_timeout, FALSE); +# endif /* ACE_HAS_PACE */ else # endif /* ACE_HAS_SIGNAL_OBJECT_AND_WAIT */ { @@ -5956,7 +5974,11 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // ACE_OS::broadcast(). # if defined (ACE_WIN32) # if !defined (ACE_USES_WINCE_SEMA_SIMULATION) +# if defined (ACE_HAS_PACE) + result = ::WaitForSingleObject (cv->sema_.sema_, msec_timeout); +# else result = ::WaitForSingleObject (cv->sema_, msec_timeout); +# endif /* ACE_HAS_PACE */ # else /* ACE_USES_WINCE_SEMA_SIMULATION */ // Can't use Win32 API on our simulated semaphores. result = ACE_OS::sema_wait (&cv->sema_, @@ -6130,7 +6152,11 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // Wait to be awakened by a ACE_OS::signal() or ACE_OS::broadcast(). # if !defined (ACE_USES_WINCE_SEMA_SIMULATION) +# if defined (ACE_HAS_PACE) + result = ::WaitForSingleObject (cv->sema_.sema_, msec_timeout); +# else result = ::WaitForSingleObject (cv->sema_, msec_timeout); +# endif /* ACE_HAS_PACE */ # else // Can't use Win32 API on simulated semaphores. result = ACE_OS::sema_wait (&cv->sema_, @@ -6201,7 +6227,11 @@ ACE_OS::cond_wait (ACE_cond_t *cv, // Wait to be awakened by a ACE_OS::cond_signal() or // ACE_OS::cond_broadcast(). # if !defined (ACE_USES_WINCE_SEMA_SIMULATION) +# if defined (ACE_HAS_PACE) + result = ::WaitForSingleObject (cv->sema_.sema_, INFINITE); +# else result = ::WaitForSingleObject (cv->sema_, INFINITE); +# endif /* ACE_HAS_PACE */ # else // Can't use Win32 API on simulated semaphores. result = ACE_OS::sema_wait (&cv->sema_); @@ -3867,7 +3867,11 @@ typedef fd_set ACE_FD_SET_TYPE; # endif /* INET6_ADDRSTRLEN */ # if defined (ACE_LACKS_SIGSET) +# if defined (ACE_HAS_PACE) +typedef pace_sigset_t sigset_t; +# else typedef u_int sigset_t; +# endif /* ACE_HAS_PACE */ # endif /* ACE_LACKS_SIGSET */ # if defined (ACE_LACKS_SIGACTION) @@ -4220,6 +4224,9 @@ typedef const ACE_TCHAR * ACE_DL_TYPE; # endif /* ACE_HAS_CHARPTR_DL */ # if !defined (ACE_HAS_SIGINFO_T) +# if defined (ACE_HAS_PACE) +typedef pace_siginfo_t siginfo_t; +# else struct ACE_Export siginfo_t { siginfo_t (ACE_HANDLE handle); @@ -4231,6 +4238,7 @@ struct ACE_Export siginfo_t ACE_HANDLE *si_handles_; // Array of Win32 HANDLEs all of which have become signaled. }; +# endif /* ACE_HAS_PACE */ # endif /* ACE_HAS_SIGINFO_T */ // Typedef for the null handler func. @@ -3516,8 +3516,14 @@ ACE_OS::sema_post (ACE_sema_t *s, size_t release_count) { #if defined (ACE_WIN32) && !defined (ACE_USES_WINCE_SEMA_SIMULATION) // Win32 supports this natively. +# if defined (ACE_HAS_PACE) + ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::ReleaseSemaphore (*(s->sema_), + release_count, 0), ace_result_), + int, -1); +# else ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::ReleaseSemaphore (*s, release_count, 0), ace_result_), int, -1); +# endif /* ACE_HAS_PACE */ #else // On POSIX platforms we need to emulate this ourselves. // @@ We can optimize on this implementation. However, @@ -6377,7 +6383,7 @@ ACE_OS::truncate (const ACE_TCHAR *filename, off_t offset) { ACE_OS_TRACE ("ACE_OS::truncate"); -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) int fd = ::pace_open (filename, O_RDWR, ACE_DEFAULT_FILE_PERMS); int result = 0; if (fd == -1) @@ -7379,6 +7385,7 @@ ACE_OS::thr_join (ACE_hthread_t thr_handle, { ACE_OS_TRACE ("ACE_OS::thr_join"); #if defined (ACE_HAS_PACE) + int ace_result_ = 0; ACE_OSCALL_RETURN ( ACE_ADAPT_RETVAL (::pace_pthread_join (thr_handle, status), ace_result_), int, -1); #elif defined (ACE_HAS_THREADS) @@ -7436,6 +7443,7 @@ ACE_OS::thr_join (ACE_thread_t waiter_id, { ACE_OS_TRACE ("ACE_OS::thr_join"); #if defined (ACE_HAS_PACE) + int ace_result_ = 0; ACE_UNUSED_ARG (thr_id); ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_join (waiter_id, status), ace_result_), int, -1); @@ -7484,6 +7492,7 @@ ACE_OS::thr_setcancelstate (int new_state, int *old_state) { ACE_OS_TRACE ("ACE_OS::thr_setcancelstate"); #if defined (ACE_HAS_PACE) + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_setcancelstate (new_state, old_state), ace_result_), int, -1); #elif defined (ACE_HAS_THREADS) @@ -7529,6 +7538,7 @@ ACE_OS::thr_setcanceltype (int new_type, int *old_type) { ACE_OS_TRACE ("ACE_OS::thr_setcanceltype"); #if defined (ACE_HAS_PACE) + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_setcanceltype (new_type, old_type), ace_result_), int, -1); #elif defined (ACE_HAS_THREADS) @@ -7566,6 +7576,7 @@ ACE_OS::thr_cancel (ACE_thread_t thr_id) { ACE_OS_TRACE ("ACE_OS::thr_cancel"); #if defined (ACE_HAS_PACE) + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_cancel (thr_id), ace_result_), int, -1); #elif defined (ACE_HAS_THREADS) @@ -7718,6 +7729,7 @@ ACE_OS::thr_sigsetmask (int how, { ACE_OS_TRACE ("ACE_OS::thr_sigsetmask"); #if defined (ACE_HAS_PACE) + int ace_result_; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_sigmask (how, nsm, osm), ace_result_), int, -1); #elif defined (ACE_HAS_THREADS) @@ -7802,6 +7814,7 @@ ACE_OS::thr_kill (ACE_thread_t thr_id, int signum) { ACE_OS_TRACE ("ACE_OS::thr_kill"); #if defined (ACE_HAS_PACE) + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_kill (thr_id, signum), ace_result_), int, -1); #elif defined (ACE_HAS_THREADS) @@ -7934,6 +7947,7 @@ ACE_OS::thr_setprio (ACE_hthread_t thr_id, int prio) if (result == -1) return result; // error in pthread_getschedparam param.sched_priority = prio; + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_setschedparam (thr_id, policy, ¶m), ace_result_), int, -1); #elif defined (ACE_HAS_THREADS) @@ -10020,7 +10034,7 @@ ACE_INLINE FILE * ACE_OS::fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode) { ACE_OS_TRACE ("ACE_OS::fdopen"); -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) ACE_OSCALL_RETURN (::pace_fdopen (handle, mode), FILE*, 0); # elif defined (ACE_WIN32) // kernel file handle -> FILE* conversion... @@ -10606,7 +10620,7 @@ ACE_OS::waitpid (pid_t pid, ACE_HANDLE handle) { ACE_OS_TRACE ("ACE_OS::waitpid"); -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) ACE_UNUSED_ARG (handle); ACE_OSCALL_RETURN (::pace_waitpid (pid, status, wait_options), int, -1); #elif defined (VXWORKS) || defined (ACE_PSOS) @@ -10754,7 +10768,7 @@ ACE_OS::sigaction (int signum, ACE_OS_TRACE ("ACE_OS::sigaction"); if (signum == 0) return 0; -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) ACE_OSCALL_RETURN (::pace_sigaction (signum, nsa, osa), int, -1); #elif defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) struct sigaction sa; @@ -11460,6 +11474,7 @@ ACE_INLINE int ACE_OS::pthread_sigmask (int how, const sigset_t *nsp, sigset_t *osp) { #if defined (ACE_HAS_PACE) + int ace_result_ = 0; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pace_pthread_sigmask (how, nsp, osp), ace_result_), int, -1); #elif defined (ACE_HAS_PTHREADS_STD) && !defined (ACE_LACKS_PTHREAD_SIGMASK) diff --git a/ace/OS_Dirent.inl b/ace/OS_Dirent.inl index e81a952a951..5064cfc089b 100644 --- a/ace/OS_Dirent.inl +++ b/ace/OS_Dirent.inl @@ -7,7 +7,7 @@ ACE_INLINE DIR * ACE_OS_Dirent::opendir (const ACE_TCHAR *filename) { -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) return pace_opendir (filename); #elif defined (ACE_HAS_DIRENT) # if defined (ACE_PSOS) @@ -46,7 +46,7 @@ ACE_OS_Dirent::opendir (const ACE_TCHAR *filename) ACE_INLINE void ACE_OS_Dirent::closedir (DIR *d) { -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) pace_closedir (d); #elif defined (ACE_HAS_DIRENT) # if defined (ACE_PSOS) @@ -82,7 +82,7 @@ ACE_OS_Dirent::closedir (DIR *d) ACE_INLINE struct dirent * ACE_OS_Dirent::readdir (DIR *d) { -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) return pace_readdir (d); #elif defined (ACE_HAS_DIRENT) # if defined (ACE_PSOS) @@ -126,7 +126,7 @@ ACE_OS_Dirent::readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result) { -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) return pace_readdir_r (dirp, entry, result); # elif !defined (ACE_HAS_REENTRANT_FUNCTIONS) ACE_UNUSED_ARG (entry); @@ -188,7 +188,7 @@ ACE_OS_Dirent::seekdir (DIR *d, long loc) ACE_INLINE void ACE_OS_Dirent::rewinddir (DIR *d) { -#if defined (ACE_HAS_PACE) +#if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) pace_rewinddir (d); #elif defined (ACE_HAS_DIRENT) # if defined (ACE_LACKS_SEEKDIR) |