More logging & some hacks

This commit is contained in:
2025-10-04 21:26:46 -06:00
parent cf7ea70fac
commit 04516b246c
3 changed files with 23 additions and 11 deletions

View File

@@ -144,11 +144,16 @@ void *threadTrampoline(void *param) {
{
std::unique_lock lk(data.obj->m);
data.obj->tib = threadTib;
data.obj->cv.wait(lk, [&] { return data.obj->suspendCount == 0; });
if (data.obj->suspendCount) {
DEBUG_LOG("Thread is suspended at start; waiting...\n");
data.obj->cv.wait(lk, [&] { return data.obj->suspendCount == 0; });
}
}
wibo::notifyDllThreadAttach();
DEBUG_LOG("Calling thread entry %p with userData %p\n", data.entry, data.userData);
DWORD result = data.entry ? data.entry(data.userData) : 0;
DEBUG_LOG("Thread exiting with code %u\n", result);
{
std::lock_guard lk(data.obj->m);
data.obj->exitCode = result;