libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::thread::thread ( const thread src)

Object copy constructor.

Parameters
[in]srcthe source object
Exceptions
std::bad_alloc

Definition at line 46 of file thread.cpp.

References m_name, m_stack, and unlikely.

47  :
48 m_name(NULL),
49 m_handle(src.m_handle),
50 m_stack(NULL),
51 m_lag(src.m_lag)
52 {
53  const i8 *nm = src.m_name;
54  if ( unlikely(nm != NULL) ) {
55  m_name = new i8[strlen(nm) + 1];
56  strcpy(m_name, nm);
57  }
58 
59  m_stack = src.m_stack->clone();
60 }
61 
62 catch (...) {
63  delete[] m_name;
64  m_name = NULL;
65 }
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