MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / onThreadAttach

Method onThreadAttach

src/hx/Debug.cpp:245–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void StackContext::onThreadAttach()
246{
247 #ifdef HXCPP_STACK_IDS
248 mThreadId = hx::thread::Thread_obj::id();
249
250 {
251 std::lock_guard<std::mutex> guard(sStackMapMutex);
252 sStackMap[mThreadId] = this;
253 }
254 #endif
255
256 #ifdef HXCPP_DEBUGGER
257 if (!mDebugger)
258 mDebugger = dbgCtxCreate(this);
259 if (mDebugger)
260 dbgCtxAttach(mDebugger,this);
261 #endif
262
263 #ifdef HXCPP_TELEMETRY
264 if (mTelemetry)
265 tlmAttach(mTelemetry,this);
266 #endif
267
268 #ifdef HXCPP_PROFILER
269 if (mProfiler)
270 profAttach(mProfiler,this);
271 #endif
272
273 #ifdef HXCPP_CATCH_SEGV
274 #ifdef _MSC_VER
275 mOldSignalFunc = _set_se_translator( hxSignalFunction );
276 #else
277 mOldSignalFunc = signal( SIGSEGV, hxSignalFunction );
278 #endif
279 #endif
280}
281
282void StackContext::onThreadDetach()
283{

Callers 3

InitAllocFunction · 0.80
SetTopOfStackFunction · 0.80
PushTopOfStackFunction · 0.80

Calls 6

idFunction · 0.85
dbgCtxCreateFunction · 0.85
dbgCtxAttachFunction · 0.85
tlmAttachFunction · 0.85
profAttachFunction · 0.85
signalFunction · 0.85

Tested by

no test coverage detected