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:
parent
f55db65292
commit
39c7950aae
1 changed files with 1 additions and 5 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue