1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

jscript: Don't use atomic compare exchange when setting the script ctx.

It already bails out early if the thread_data was already populated, so
only one thread can reach here at one time.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2023-12-12 19:57:37 +02:00 committed by Alexandre Julliard
parent f55db65292
commit 39c7950aae

View file

@ -776,11 +776,7 @@ static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface,
ctx->last_match = jsstr_empty();
ctx = InterlockedCompareExchangePointer((void**)&This->ctx, ctx, NULL);
if(ctx) {
script_release(ctx);
return E_UNEXPECTED;
}
This->ctx = ctx;
}
/* Retrieve new dispatches for persistent named items */