libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::thread::thread ( const i8 nm = NULL)
explicit

Object constructor.

Parameters
[in]nmthe thread name (it can be NULL)
Exceptions
std::bad_alloc

Definition at line 18 of file thread.cpp.

References m_name, m_stack, and unlikely.

Referenced by clone().

19  :
20 m_name(NULL),
21 m_handle(pthread_self()),
22 m_stack(NULL),
23 m_lag(0)
24 {
25  if ( unlikely(nm != NULL) ) {
26  m_name = new i8[strlen(nm) + 1];
27  strcpy(m_name, nm);
28  }
29 
30  m_stack = new stack<call>;
31 }
32 
33 catch (...) {
34  delete[] m_name;
35  m_name = NULL;
36 }
i8 * m_name
Thread name.
Definition: thread.hpp:33
char i8
8-bit signed integer
Definition: config.hpp:72
stack< call > * m_stack
Simulated call stack.
Definition: thread.hpp:37
i32 m_lag
The number of calls that must be popped off the simulated stack for it to match the real one...
Definition: thread.hpp:39
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
pthread_t m_handle
Thread handle.
Definition: thread.hpp:35

+ Here is the caller graph for this function: