summaryrefslogtreecommitdiff
path: root/ACE/examples/Threads/TSS_Data.h
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/examples/Threads/TSS_Data.h')
-rw-r--r--ACE/examples/Threads/TSS_Data.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/ACE/examples/Threads/TSS_Data.h b/ACE/examples/Threads/TSS_Data.h
new file mode 100644
index 00000000000..3c9dfcfe28c
--- /dev/null
+++ b/ACE/examples/Threads/TSS_Data.h
@@ -0,0 +1,40 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// examples
+//
+// = FILENAME
+// TSS_Data.cpp
+//
+// = AUTHOR
+// Prashant Jain and Doug Schmidt
+//
+// ============================================================================
+
+#include "ace/Singleton.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Synch_Traits.h"
+
+class TSS_Data
+ // = TITLE
+ // Data that is stored in thread-specific storage.
+{
+public:
+ void *data (void) { return this->data_; }
+ void data (void *v) { this->data_ = v; }
+
+private:
+ // = data_ will be thread-specific data so it doesn't need a lock.
+ void *data_;
+};
+
+typedef ACE_TSS_Singleton<TSS_Data, ACE_SYNCH_MUTEX> TSS_DATA;
+
+
+