MCPcopy Create free account
hub / github.com/chromium/crashpad / PthreadToThreadID

Function PthreadToThreadID

snapshot/mac/process_reader_mac_test.cc:154–159  ·  view source on GitHub ↗

Returns a thread ID given a pthread_t. This wraps pthread_threadid_np() but that function has a cumbersome interface because it returns a success value. This function CHECKs success and returns the thread ID directly.

Source from the content-addressed store, hash-verified

152// that function has a cumbersome interface because it returns a success value.
153// This function CHECKs success and returns the thread ID directly.
154uint64_t PthreadToThreadID(pthread_t pthread) {
155 uint64_t thread_id;
156 errno = pthread_threadid_np(pthread, &thread_id);
157 PCHECK(errno == 0) << "pthread_threadid_np";
158 return thread_id;
159}
160
161TEST(ProcessReaderMac, SelfOneThread) {
162 const ScopedSetThreadName scoped_set_thread_name(

Callers 2

TESTFunction · 0.85
GetThreadInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected