diff options
Diffstat (limited to 'ACE/ace/OS_NS_Thread.h')
-rw-r--r-- | ACE/ace/OS_NS_Thread.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/ACE/ace/OS_NS_Thread.h b/ACE/ace/OS_NS_Thread.h index f932a701cea..98a24079307 100644 --- a/ACE/ace/OS_NS_Thread.h +++ b/ACE/ace/OS_NS_Thread.h @@ -356,7 +356,7 @@ public: /// Queue up threads waiting for the condition to become signaled. ACE_sema_t sema_; -# if defined (ACE_VXWORKS) +# if defined (ACE_VXWORKS) || defined (ACE_MQX) /** * A semaphore used by the broadcast/signal thread to wait for all * the waiting thread(s) to wake up and be released from the @@ -391,10 +391,12 @@ struct ACE_Export ACE_condattr_t int type; }; +#if !defined (ACE_MQX) struct ACE_Export ACE_mutexattr_t { int type; }; +#endif ACE_END_VERSIONED_NAMESPACE_DECL @@ -1754,6 +1756,26 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION ssize_t thr_id (char buffer[], size_t buffer_length); + /** + * For systems that support it (Only Linux as of writing), this is a wrapper + * for pid_t gettid(). + * + * It returns the system-wide thread id (TID) for the current thread. These + * are similar to PIDs and, for x86 Linux at least, are much shorter than + * what is returned from thr_self(), which is an address. + * + * For older Linux (pre 2.4.11) and other systems that don't have gettid(), + * this uses ACE_NOTSUP_RETURN (-1). + */ + pid_t thr_gettid (); + + /** + * Puts the string representation of pid_t thr_gettid() into the buffer and + * returns number of bytes added. + */ + ACE_NAMESPACE_INLINE_FUNCTION + ssize_t thr_gettid (char buffer[], size_t buffer_length); + /// State is THR_CANCEL_ENABLE or THR_CANCEL_DISABLE ACE_NAMESPACE_INLINE_FUNCTION int thr_setcancelstate (int new_state, int *old_state); |