From edc039e19ae0b277132d6c4f3a3f5b976afdd7d6 Mon Sep 17 00:00:00 2001 From: nanbor Date: Tue, 4 Aug 1998 16:45:11 +0000 Subject: Added signaling functionality to the token --- ace/Token.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'ace/Token.h') diff --git a/ace/Token.h b/ace/Token.h index 150788669b6..a9e6db598bc 100644 --- a/ace/Token.h +++ b/ace/Token.h @@ -72,7 +72,8 @@ public: // Return values: // 0 if acquires without calling // 1 if is called. - // -1 if failure or timeout occurs (if timeout occurs errno == ETIME) + // 2 if the token is signaled. + // -1 if failure or timeout occurs (if timeout occurs errno == ETIME) // If == <&ACE_Time_Value::zero> then acquire has polling // semantics (and does *not* call ). @@ -146,6 +147,17 @@ public: ACE_thread_t current_owner (void); // Return the id of the current thread that owns the token. + int signal_all_threads (); + // Force all threads waiting to acquire the token to return one by + // one. The method sets the to non-zero if + // there're threads waiting, and returns the number of threads + // waiting. If there's no thread waiting for the token, the call + // returns 0 and doesn't do anything. The last thread releases the + // token also reset the flag to 0. This means, + // any threads that try to acquire the token after the call is + // issued will also get "signaled" and the number of threads waiting + // the token is only a snapshot. + void dump (void) const; // Dump the state of an object. @@ -231,6 +243,9 @@ private: int nesting_level_; // Current nesting level. + + int signal_all_threads_; + // Whether we are "signaling" all threads or not. }; #if defined (__ACE_INLINE__) -- cgit v1.2.1