summaryrefslogtreecommitdiff
path: root/examples/Threads/tss1.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>1997-11-22 23:54:55 +0000
committerSteve Huston <shuston@riverace.com>1997-11-22 23:54:55 +0000
commitc3b5a2ae8f914a4680bacf50bcaddcbbf696fcb9 (patch)
tree6d1366389fcfabf66aa965471882bd148bf9ed33 /examples/Threads/tss1.cpp
parent8e5217a61faa7ff4d536ff3969f58fc92f1625ea (diff)
downloadATCD-c3b5a2ae8f914a4680bacf50bcaddcbbf696fcb9.tar.gz
Moved class Errno out from thread_specific.cpp and tss1.cpp to a new
header file, thread_specific.h. AIX needs the class in a .h file.
Diffstat (limited to 'examples/Threads/tss1.cpp')
-rw-r--r--examples/Threads/tss1.cpp38
1 files changed, 2 insertions, 36 deletions
diff --git a/examples/Threads/tss1.cpp b/examples/Threads/tss1.cpp
index cc3c863d1a3..1d0a76c788d 100644
--- a/examples/Threads/tss1.cpp
+++ b/examples/Threads/tss1.cpp
@@ -27,45 +27,11 @@
#if defined (ACE_HAS_THREADS)
+#include "thread_specific.h"
+
// (Sun C++ 4.2 with -O3 won't link if the following is not const.)
static const int iterations = 100;
-class Errno
-{
-public:
- int error (void) { return this->errno_; }
- void error (int i) { this->errno_ = i; }
-
- int line (void) { return this->lineno_; }
- void line (int l) { this->lineno_ = l; }
-
- // Errno::flags_ is a static variable, so we've got to protect it
- // with a mutex since it isn't kept in thread-specific storage.
- int flags (void) {
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_Mon, Errno::lock_, -1));
-
- return Errno::flags_;
- }
- int flags (int f)
- {
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, Errno::lock_, -1));
-
- Errno::flags_ = f;
- return 0;
- }
-
-private:
- // = errno_ and lineno_ will be thread-specific data so they don't
- // need a lock.
- int errno_;
- int lineno_;
-
- static int flags_;
-#if defined (ACE_HAS_THREADS)
- // flags_ needs a lock.
- static ACE_Thread_Mutex lock_;
-#endif /* ACE_HAS_THREADS */
-};
// Static variables.
ACE_MT (ACE_Thread_Mutex Errno::lock_);