MCPcopy Create free account
hub / github.com/davisking/dlib / spawn_thread

Function spawn_thread

dlib/threads/threads_kernel_2.cpp:45–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 // -----------------------------------------------------------------------------------
44
45 bool spawn_thread (
46 void (*funct)(void*),
47 void* param
48 )
49 {
50 info* p;
51 try { p = new info; }
52 catch (...) { return false; }
53
54 p->funct = funct;
55 p->param = param;
56
57 pthread_t thread_id;
58 if ( pthread_create (&thread_id, 0, thread_starter, p) )
59 {
60 delete p;
61 return false;
62 }
63 return true;
64 }
65
66 // -----------------------------------------------------------------------------------
67

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected