Skip to content

Commit

Permalink
Backported fix for CORE-3859: Too many different dynamic events crash…
Browse files Browse the repository at this point in the history
… server
  • Loading branch information
AlexPeshkoff committed Jun 4, 2012
1 parent c36c061 commit 9f3bb0e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/jrd/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ SLONG EVENT_que(ISC_STATUS* status_vector,
}


// Protects EVENT_header from being changed by another thread
// when MUTEX is already passed to ISC_mutex_lock()
static Firebird::Mutex remapMutex;

static EVH acquire(void)
{
/**************************************
Expand All @@ -542,6 +546,8 @@ static EVH acquire(void)
*
**************************************/

Firebird::MutexLockGuard g(remapMutex);

int mutex_state;
#ifdef MULTI_THREAD
if (mutex_state = ISC_mutex_lock(MUTEX))
Expand Down Expand Up @@ -615,6 +621,8 @@ static FRB alloc_global(UCHAR type, ULONG length, bool recurse)
}

if (!best && !recurse) {
Firebird::MutexLockGuard g(remapMutex);

const SLONG old_length = EVENT_data.sh_mem_length_mapped;
const SLONG ev_length = old_length + EVENT_EXTEND_SIZE;

Expand Down

0 comments on commit 9f3bb0e

Please sign in to comment.