Skip to content

Commit

Permalink
Fixed CORE-3859: Too many different dynamic events crash server
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPeshkoff committed Jun 4, 2012
1 parent cec7e45 commit c464697
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/jrd/event.cpp
Expand Up @@ -500,6 +500,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 @@ -513,6 +517,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 @@ -584,6 +590,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 c464697

Please sign in to comment.