Cleanup libcsdbg-related thread resources upon thread cancellation.
- Parameters
-
- Returns
- *this
- Attention
- This method should be called from thread cancellation handlers to release resources. If you don't cleanup the thread handle though it becomes useless when the actual thread has exited, it continues to occupy memory and will also inject junk, empty traces in dumps or in explicit trace requests
- See Also
- man pthread_cleanup_push, pthread_cleanup_pop
Definition at line 463 of file process.cpp.
References csdbg::thread::is_current(), likely, csdbg::util::lock(), m_threads, unlikely, and csdbg::util::unlock().
469 if (
unlikely(thr->is_current()) ) {
chain< thread > * m_threads
Instrumented thread list.
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
static void lock()
Lock the global access mutex.
static void unlock()
Unlock the global access mutex.
unsigned int u32
32-bit unsigned integer
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.