diff options
author | Fred Hornsey <fred@hornsey.us> | 2019-04-11 23:43:06 -0500 |
---|---|---|
committer | Fred Hornsey <fred@hornsey.us> | 2019-04-11 23:43:06 -0500 |
commit | e06e966e10b4edb27f9813ddffc34529abd4bb91 (patch) | |
tree | 4de96a9c581cd10fe80439df5448f49fe98b645a /ACE/ace/OS_NS_Thread.h | |
parent | 6077b11bb47d50d264f1ed095df2a0c499f74c90 (diff) | |
download | ATCD-e06e966e10b4edb27f9813ddffc34529abd4bb91.tar.gz |
Add ACE_OS::thr_gettid()
Diffstat (limited to 'ACE/ace/OS_NS_Thread.h')
-rw-r--r-- | ACE/ace/OS_NS_Thread.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ACE/ace/OS_NS_Thread.h b/ACE/ace/OS_NS_Thread.h index f932a701cea..061351c2dcd 100644 --- a/ACE/ace/OS_NS_Thread.h +++ b/ACE/ace/OS_NS_Thread.h @@ -1754,6 +1754,24 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION ssize_t thr_id (char buffer[], size_t buffer_length); +#ifdef ACE_HAS_GETTID + /** + * Wrapper for pid_t gettid(). For systems that support it (only Linux as of + * writing), get the system-wide thread id (TID) for the current thread. + * + * These are similar to PIDs and, on x86 Linux at least, are much shorter + * than the what is returned from thr_id(), which is represents a address. + */ + 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); +#endif + /// State is THR_CANCEL_ENABLE or THR_CANCEL_DISABLE ACE_NAMESPACE_INLINE_FUNCTION int thr_setcancelstate (int new_state, int *old_state); |