summaryrefslogtreecommitdiff
path: root/ace/Token.h
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-04 16:45:11 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-04 16:45:11 +0000
commitedc039e19ae0b277132d6c4f3a3f5b976afdd7d6 (patch)
tree52b91a09def2d4dfb54f0074b6e8c6e29f9d7346 /ace/Token.h
parent613ffe064597a1b52de9b6f6c2e77d41207f9bef (diff)
downloadATCD-edc039e19ae0b277132d6c4f3a3f5b976afdd7d6.tar.gz
Added signaling functionality to the token
Diffstat (limited to 'ace/Token.h')
-rw-r--r--ace/Token.h17
1 files changed, 16 insertions, 1 deletions
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 <sleep_hook>
// 1 if <sleep_hook> 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 <timeout> == <&ACE_Time_Value::zero> then acquire has polling
// semantics (and does *not* call <sleep_hook>).
@@ -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 <signal_all_thread_> 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 <singal_all_thread_> 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__)