MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / AttachCallback

Function AttachCallback

pydevd_attach_to_process/windows/attach.cpp:116–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115
116int AttachCallback(void *voidInitializeThreadingInfo) {
117 // initialize us for threading, this will acquire the GIL if not already created, and is a nop if the GIL is created.
118 // This leaves us in the proper state when we return back to the runtime whether the GIL was created or not before
119 // we were called.
120 InitializeThreadingInfo* initializeThreadingInfo = reinterpret_cast<InitializeThreadingInfo*>(voidInitializeThreadingInfo);
121 initializeThreadingInfo->initThreads(); // Note: calling multiple times is ok.
122 initializeThreadingInfo->pyImportMod("threading");
123
124 EnterCriticalSection(&initializeThreadingInfo->cs);
125 initializeThreadingInfo->completed = true;
126 if(initializeThreadingInfo->initedEvent != nullptr) {
127 SetEvent(initializeThreadingInfo->initedEvent);
128 }
129 LeaveCriticalSection(&initializeThreadingInfo->cs);
130 return 0;
131}
132
133
134// create a custom heap for our unordered map. This is necessary because if we suspend a thread while in a heap function

Callers

nothing calls this directly

Calls 1

SetEventFunction · 0.85

Tested by

no test coverage detected