Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@e4493a2fe7
Browse files Browse the repository at this point in the history
[1.8>1.9] [MERGE #4643 @MikeHolman] fix race condition where multiple threads simultaneously connect

Merge pull request #4643 from MikeHolman:connectrace

Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
  • Loading branch information
MikeHolman authored and chakrabot committed Feb 7, 2018
1 parent 06c6da9 commit d6fe9af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
13 changes: 5 additions & 8 deletions deps/chakrashim/core/lib/JITClient/JITManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,17 @@ JITManager::IsOOPJITEnabled() const
HRESULT
JITManager::ConnectRpcServer(__in HANDLE jitProcessHandle, __in_opt void* serverSecurityDescriptor, __in UUID connectionUuid)
{
// We might be trying to connect from multiple threads simultaneously
AutoCriticalSection cs(&m_cs);

Assert(IsOOPJITEnabled());
if(m_rpcBindingHandle != nullptr)
if (m_rpcBindingHandle != nullptr)
{
// TODO: change this to allow connecting a new JIT process to new ThreadContexts
return E_FAIL;
return S_OK;
}

HRESULT hr = E_FAIL;

if (IsConnected())
{
Assert(UNREACHED);
return E_FAIL;
}

hr = CreateBinding(jitProcessHandle, serverSecurityDescriptor, &connectionUuid, &m_rpcBindingHandle);
if (FAILED(hr))
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/lib/JITClient/JITManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class JITManager
bool m_oopJitEnabled;
bool m_isJITServer;
HRESULT m_failingHRESULT;
CriticalSection m_cs;

static JITManager s_jitManager;

Expand Down

0 comments on commit d6fe9af

Please sign in to comment.