summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-12-24 18:04:35 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-12-24 18:04:35 +0000
commitffb5cb8f445d8127916a4a0f189474b4747651b6 (patch)
treefc62e38b45e502b044a8466d564bb01f34414388
parent4430270d6365b6eb0bc4e83277be1f4e5f9b7237 (diff)
downloadATCD-ffb5cb8f445d8127916a4a0f189474b4747651b6.tar.gz
foo
-rw-r--r--ace/OS.i10
-rw-r--r--ace/Synch.cpp16
-rw-r--r--ace/Synch.h18
-rw-r--r--ace/Synch_T.cpp17
-rw-r--r--ace/Synch_T.h23
5 files changed, 37 insertions, 47 deletions
diff --git a/ace/OS.i b/ace/OS.i
index 18bd98bb976..0085266756a 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -1225,7 +1225,8 @@ ACE_OS::cond_wait (ACE_cond_t *cv,
#if defined (ACE_HAS_SIGNAL_OBJECT_AND_WAIT)
// This call will automatically release the mutex and wait on the semaphore.
- result = ::SignalObjectAndWait (*external_mutex, cv->sema_, INFINITE, FALSE);
+ ACE_OSCALL (ACE_ADAPT_RETVAL (::SignalObjectAndWait (*external_mutex, cv->sema_, INFINITE, FALSE), result),
+ int, -1, result);
#else
// We keep the lock held just long enough to increment the count of
// waiters by one. Note that we can't keep it held across the call
@@ -1236,12 +1237,9 @@ ACE_OS::cond_wait (ACE_cond_t *cv,
// Wait to be awakened by a ACE_OS::cond_signal() or
// ACE_OS::cond_broadcast().
- result = ::WaitForSingleObject (cv->sema_, INFINITE);
+ result = ACE_OS::sema_wait (cv->sema_);
#endif /* ACE_HAS_SIGNAL_OBJECT_AND_WAIT */
- if (result != WAIT_OBJECT_0)
- // This is a hack, we need to find an appropriate mapping...
- error = result == WAIT_TIMEOUT ? ETIME : ::GetLastError ();
- else
+ if (result != -1)
{
// If we are broadcasting, then we need to be smarter about
// locking since there can now be multiple threadsd in the
diff --git a/ace/Synch.cpp b/ace/Synch.cpp
index b163eecc7a6..eb1a2f159e2 100644
--- a/ace/Synch.cpp
+++ b/ace/Synch.cpp
@@ -824,6 +824,22 @@ ACE_Process_Barrier::dump (void) const
ACE_Barrier::dump ();
}
+template <class MUTEX> void
+ACE_Process_Condition<MUTEX>::dump (void) const
+{
+// ACE_TRACE ("ACE_Process_Condition<MUTEX>::dump");
+
+ ACE_Condition<MUTEX>::dump ();
+}
+
+template <class MUTEX>
+ACE_Process_Condition<MUTEX>::ACE_Process_Condition (MUTEX &m,
+ LPCTSTR name,
+ void *arg)
+ : ACE_Condition<MUTEX> (m, USYNC_PROCESS, name, arg)
+{
+// ACE_TRACE ("ACE_Process_Condition<MUTEX>::ACE_Process_Condition");
+}
#endif /* 0 */
ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Mutex)
diff --git a/ace/Synch.h b/ace/Synch.h
index 1c0c5335b87..6d3e864d582 100644
--- a/ace/Synch.h
+++ b/ace/Synch.h
@@ -1001,6 +1001,22 @@ private:
};
#if 0
+class ACE_Process_Condition
+ // = TITLE
+ // ACE_Condition variable wrapper that works across processes.
+{
+public:
+ ACE_Process_Condition (MUTEX &m, LPCTSTR name = 0, void *arg = 0);
+
+ void dump (void) const;
+ // Dump the state of an object.
+
+ // ACE_ALLOC_HOOK_DECLARE;
+ // Declare the dynamic allocation hooks.
+};
+#endif /* ACE_HAS_STHREADS */
+
+#if 0
class ACE_Export ACE_Process_Barrier : public ACE_Barrier
// = TITLE
// Implements "barrier synchronization" using ACE_Process_Mutexes!
@@ -1031,7 +1047,7 @@ class ACE_Export ACE_Thread_Barrier : public ACE_Barrier
{
public:
ACE_Thread_Barrier (u_int count, LPCTSTR name = 0);
- // Create a Process_Barrier, passing in the optional <name>.
+ // Create a Thread_Barrier, passing in the optional <name>.
void dump (void) const;
// Dump the state of an object.
diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp
index 60e0b02908f..9cab6f23136 100644
--- a/ace/Synch_T.cpp
+++ b/ace/Synch_T.cpp
@@ -136,23 +136,6 @@ ACE_Thread_Condition<MUTEX>::dump (void) const
ACE_Condition<MUTEX>::dump ();
}
-template <class MUTEX> void
-ACE_Process_Condition<MUTEX>::dump (void) const
-{
-// ACE_TRACE ("ACE_Process_Condition<MUTEX>::dump");
-
- ACE_Condition<MUTEX>::dump ();
-}
-
-template <class MUTEX>
-ACE_Process_Condition<MUTEX>::ACE_Process_Condition (MUTEX &m,
- LPCTSTR name,
- void *arg)
- : ACE_Condition<MUTEX> (m, USYNC_PROCESS, name, arg)
-{
-// ACE_TRACE ("ACE_Process_Condition<MUTEX>::ACE_Process_Condition");
-}
-
template <class MUTEX>
ACE_Condition<MUTEX>::ACE_Condition (MUTEX &m,
int type,
diff --git a/ace/Synch_T.h b/ace/Synch_T.h
index 9d5da5922b1..167bf36950a 100644
--- a/ace/Synch_T.h
+++ b/ace/Synch_T.h
@@ -549,29 +549,6 @@ private:
void operator= (const ACE_Condition<MUTEX> &) {}
ACE_Condition (const ACE_Condition<MUTEX> &c): mutex_ (c.mutex_) {}
};
-
-template <class MUTEX>
-class ACE_Process_Condition : public ACE_Condition<MUTEX>
- // = TITLE
- // ACE_Condition variable wrapper that works across processes.
- //
- // = DESCRIPTION
- // Note that this implementation only works on OS platforms
- // (e.g., Solaris and some implementations of POSIX pthreads)
- // that natively implement condition variables and mutexes with
- // USYNC_PROCESS scope. In particular, this won't work on
- // Win32, where these synchronization mechanisms are emulated.
-{
-public:
- ACE_Process_Condition (MUTEX &m, LPCTSTR name = 0, void *arg = 0);
-
- void dump (void) const;
- // Dump the state of an object.
-
- // ACE_ALLOC_HOOK_DECLARE;
- // Declare the dynamic allocation hooks.
-};
-
template <class MUTEX>
class ACE_Thread_Condition : public ACE_Condition<MUTEX>
// = TITLE