Skip to content

Commit

Permalink
Fixed bug CORE-4753 : Firebird hangs in embed mode.
Browse files Browse the repository at this point in the history
Removed annoying wrong assertion.
  • Loading branch information
hvlad committed Apr 21, 2015
1 parent e0a4131 commit 67383e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/common/isc_sync.cpp
Expand Up @@ -2184,6 +2184,8 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
CloseHandle(file_handle);
Arg::Gds(isc_unavailable).raise();
}

SetHandleInformation(event_handle, HANDLE_FLAG_INHERIT, 0);
}

if (length == 0)
Expand Down Expand Up @@ -2303,6 +2305,7 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
CloseHandle(file_handle);
goto retry;
}
SetHandleInformation(header_obj, HANDLE_FLAG_INHERIT, 0);

ULONG* const header_address = (ULONG*) MapViewOfFile(header_obj, FILE_MAP_WRITE, 0, 0, 0);

Expand Down Expand Up @@ -2354,6 +2357,7 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
CloseHandle(file_handle);
system_call_failed::raise("CreateFileMapping", err);
}
SetHandleInformation(file_obj, HANDLE_FLAG_INHERIT, 0);

UCHAR* const address = (UCHAR*) MapViewOfFile(file_obj, FILE_MAP_WRITE, 0, 0, 0);

Expand Down Expand Up @@ -2814,6 +2818,8 @@ static bool initializeFastMutex(FAST_MUTEX* lpMutex, LPSECURITY_ATTRIBUTES lpAtt

if (lpMutex->hEvent)
{
SetHandleInformation(lpMutex->hEvent, HANDLE_FLAG_INHERIT, 0);

if (lpName)
sprintf(sz, FAST_MUTEX_MAP_NAME, lpName);

Expand All @@ -2829,6 +2835,8 @@ static bool initializeFastMutex(FAST_MUTEX* lpMutex, LPSECURITY_ATTRIBUTES lpAtt

if (lpMutex->hFileMap)
{
SetHandleInformation(lpMutex->hFileMap, HANDLE_FLAG_INHERIT, 0);

lpMutex->lpSharedInfo = (FAST_MUTEX_SHARED_SECTION*)
MapViewOfFile(lpMutex->hFileMap, FILE_MAP_WRITE, 0, 0, 0);

Expand Down
11 changes: 4 additions & 7 deletions src/common/os/win32/isc_ipc.cpp
Expand Up @@ -176,7 +176,7 @@ int ISC_kill(SLONG pid, SLONG signal_number, void *object_hndl)
return SetEvent(handle) ? 0 : -1;
}

void* ISC_make_signal(bool create_flag, bool manual_reset, int process_idL, int signal_number)
void* ISC_make_signal(bool /*create_flag*/, bool manual_reset, int process_idL, int signal_number)
{
/**************************************
*
Expand Down Expand Up @@ -206,14 +206,11 @@ void* ISC_make_signal(bool create_flag, bool manual_reset, int process_idL, int
return NULL;
}

HANDLE hEvent = OpenEvent(EVENT_ALL_ACCESS, TRUE, event_name);
HANDLE hEvent = CreateEvent(ISC_get_security_desc(), man_rst, FALSE, event_name);

if (create_flag)
{
fb_assert(!hEvent);
hEvent = CreateEvent(ISC_get_security_desc(), man_rst, FALSE, event_name);
if (hEvent) {
SetHandleInformation(hEvent, HANDLE_FLAG_INHERIT, 0);
}

return hEvent;
}

Expand Down

0 comments on commit 67383e1

Please sign in to comment.