forked from len0rd/rockbox
quake: fix race condition
COM_LoadStackFile was not thread-safe since it relied on a global variable to pass the loadbuf parameter to COM_LoadFile. This was causing mysterious crashes when model loading and audio mixing were happening simultaneously. Change-Id: I505c5ef0ed49d0c4aa4b11cfed05647c75b5b40d
This commit is contained in:
parent
0b23348610
commit
caee6c578d
2 changed files with 37 additions and 7 deletions
|
@ -1472,8 +1472,11 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
|
|||
|
||||
version = LittleLongUnaligned (pinmodel->version);
|
||||
if (version != ALIAS_VERSION)
|
||||
{
|
||||
rb->splashf(HZ*2, "Likely race condition! S_LoadSound and this use the same allocator!");
|
||||
Sys_Error ("%s has wrong version number (%i should be %i)",
|
||||
mod->name, version, ALIAS_VERSION);
|
||||
}
|
||||
|
||||
//
|
||||
// allocate space for a working header, plus all the data except the frames,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue