fix: continue main thread on C++ side again, circumvents a race condition - we should fix this for good!

This commit is contained in:
goaaats 2022-06-03 17:45:54 +02:00
parent f8243e2c3c
commit 7d49ebfc3c
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
2 changed files with 5 additions and 4 deletions

View file

@ -393,10 +393,10 @@ DllExport void WINAPI RewrittenEntryPoint(RewrittenEntryPointParameters& params)
loadInfo = params.pLoadInfo; loadInfo = params.pLoadInfo;
// Let the game initialize. // Let the game initialize.
//SetEvent(params.hMainThreadContinue); SetEvent(params.hMainThreadContinue);
} }
//wait_for_game_window(); wait_for_game_window();
Initialize(&loadInfo[0], params.hMainThreadContinue); Initialize(&loadInfo[0], params.hMainThreadContinue);
return 0; return 0;

View file

@ -110,8 +110,9 @@ namespace Dalamud
Service<HookManager>.Set(); Service<HookManager>.Set();
// Signal the main game thread to continue // Signal the main game thread to continue
NativeFunctions.SetEvent(this.mainThreadContinueEvent); // TODO: This is done in rewrite_entrypoint.cpp again to avoid a race condition. Should be fixed!
Log.Information("[T1] Game thread continued!"); // NativeFunctions.SetEvent(this.mainThreadContinueEvent);
// Log.Information("[T1] Game thread continued!");
// Initialize FFXIVClientStructs function resolver // Initialize FFXIVClientStructs function resolver
using (Timings.Start("CS Resolver Init")) using (Timings.Start("CS Resolver Init"))