Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/isc_s_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct mtx
struct event_t
{
SLONG event_count;
int pid;
int event_pid;
pthread_mutex_t event_mutex[1];
pthread_cond_t event_cond[1];
};
Expand Down
10 changes: 7 additions & 3 deletions src/common/isc_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ int SharedMemoryBase::eventInit(event_t* event)
#else // pthread-based event

event->event_count = 0;
event->pid = getpid();
event->event_pid = getpid();

// Prepare an Inter-Process event block
pthread_mutexattr_t mattr;
Expand Down Expand Up @@ -662,7 +662,7 @@ void SharedMemoryBase::eventFini(event_t* event)

#else // pthread-based event

if (event->pid == getpid())
if (event->event_pid == getpid())
{
LOG_PTHREAD_ERROR(pthread_mutex_destroy(event->event_mutex));
LOG_PTHREAD_ERROR(pthread_cond_destroy(event->event_cond));
Expand Down Expand Up @@ -691,6 +691,8 @@ SLONG SharedMemoryBase::eventClear(event_t* event)
*
**************************************/

fb_assert(event->event_pid == getpid());

#if defined(WIN_NT)

ResetEvent(event->event_handle);
Expand Down Expand Up @@ -722,6 +724,8 @@ int SharedMemoryBase::eventWait(event_t* event, const SLONG value, const SLONG m
*
**************************************/

fb_assert(event->event_pid == getpid());

// If we're not blocked, the rest is a gross waste of time

if (!event_blocked(event, value)) {
Expand Down Expand Up @@ -831,7 +835,7 @@ int SharedMemoryBase::eventPost(event_t* event)
++event->event_count;

if (event->event_pid != process_id)
return ISC_kill(event->event_pid, event->event_id, event->event_handle);
return ISC_kill(event->event_pid, event->event_id, event->event_handle) == 0 ? FB_SUCCESS : FB_FAILURE;

return SetEvent(event->event_handle) ? FB_SUCCESS : FB_FAILURE;

Expand Down
13 changes: 11 additions & 2 deletions src/jrd/Attachment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,16 @@ bool Attachment::isProfilerActive()
return att_profiler_manager && att_profiler_manager->isActive();
}

void Attachment::releaseProfilerManager()
void Attachment::releaseProfilerManager(thread_db* tdbb)
{
att_profiler_manager.reset();
if (!att_profiler_manager)
return;

if (att_profiler_manager->haveListener())
{
EngineCheckout cout(tdbb, FB_FUNCTION);
att_profiler_manager.reset();
}
else
att_profiler_manager.reset();
}
2 changes: 1 addition & 1 deletion src/jrd/Attachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ class Attachment : public pool_alloc<type_att>
ProfilerManager* getProfilerManager(thread_db* tdbb);
ProfilerManager* getActiveProfilerManagerForNonInternalStatement(thread_db* tdbb);
bool isProfilerActive();
void releaseProfilerManager();
void releaseProfilerManager(thread_db* tdbb);

JProvider* getProvider()
{
Expand Down
Loading