1 #ifndef ACE_THREAD_SPECIFIC_H
3 #include "ace/Guard_T.h"
4 #include "ace/Thread_Mutex.h"
6 // Define a class that will be stored in thread-specific data. Note
7 // that as far as this class is concerned it's just a regular C++
8 // class. The ACE_TSS wrapper transparently ensures that objects of
9 // this class will be placed in thread-specific storage. All calls on
10 // ACE_TSS::operator->() are delegated to the appropriate method in
16 int error () { return this->errno_
; }
17 void error (int i
) { this->errno_
= i
; }
19 int line () { return this->lineno_
; }
20 void line (int l
) { this->lineno_
= l
; }
22 // Errno::flags_ is a static variable, so we've got to protect it
23 // with a mutex since it isn't kept in thread-specific storage.
26 ACE_GUARD_RETURN (ACE_Thread_Mutex
, ace_mon
, Errno::lock_
, -1);
33 ACE_GUARD (ACE_Thread_Mutex
, ace_mon
, Errno::lock_
);
39 // = errno_ and lineno_ will be thread-specific data so they don't
45 #if defined (ACE_HAS_THREADS)
46 // flags_ needs a lock.
47 static ACE_Thread_Mutex lock_
;
48 #endif /* ACE_HAS_THREADS */
51 #endif /* ACE_THREAD_SPECIFIC_H */