MCPcopy Create free account
hub / github.com/Haivision/srt / StartThread

Function StartThread

srtcore/sync.cpp:84–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82bool StartThread(CThread& th, ThreadFunc&& f, void* args, const string& name)
83#else
84bool StartThread(CThread& th, void* (*f) (void*), void* args, const string& name)
85#endif
86{
87 ThreadName tn(name);
88 try
89 {
90#if HAVE_FULL_CXX11 || defined(ENABLE_STDCXX_SYNC)
91 th = CThread(f, args);
92#else
93 // No move semantics in C++03, therefore using a dedicated function
94 th.create_thread(f, args);
95#endif
96 }
97#if ENABLE_HEAVY_LOGGING
98 catch (const CThreadException& e)
99#else
100 catch (const CThreadException&)
101#endif
102 {
103 HLOGC(inlog.Debug, log << name << ": failed to start thread. " << e.what());
104 return false;
105 }
106 return true;
107}
108
109} // namespace sync
110} // namespace srt

Callers 4

startGarbageCollectorMethod · 0.85
initMethod · 0.85
TESTFunction · 0.85

Calls 3

CThreadClass · 0.85
create_threadMethod · 0.80
whatMethod · 0.80

Tested by 1

TESTFunction · 0.68