mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
RTech: use Pak_UnloadAsyncAndWait for pak swap
Use the actual api as this allows for helping other jobs as well rather than burning all cpu in our own thread.
This commit is contained in:
parent
ba83bd9ae9
commit
72c71fac8b
@ -166,11 +166,7 @@ static void Pak_Swap_f(const CCommand& args)
|
||||
}
|
||||
|
||||
Msg(eDLL_T::RTECH, "Requested pak swap for handle '%d'\n", pakHandle);
|
||||
g_pakLoadApi->UnloadAsync(pakHandle);
|
||||
|
||||
// TODO[ AMOS ]: use Pak_UnloadAsyncAndWaitOrHelp here.
|
||||
while (pakInfo->status != PakStatus_e::PAK_STATUS_FREED) // Wait till this slot gets free'd.
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
g_pakLoadApi->UnloadAsyncAndWait(pakHandle); // Wait till this slot gets free'd.
|
||||
|
||||
g_pakLoadApi->LoadAsync(pakName, AlignedMemAlloc(), pakInfo->logChannel, 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user