Module: wine Branch: master Commit: 39c7950aae9d2c0b3a51995c49713ed124898b28 URL: https://gitlab.winehq.org/wine/wine/-/commit/39c7950aae9d2c0b3a51995c49713ed... Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Dec 12 19:57:37 2023 +0200 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(a)gmail.com> --- dlls/jscript/jscript.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 191747c7173..32e6278a5d0 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -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 */