mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 10:03:03 +01:00
Backported CORE-6027: Server hang on new attachment right after trace session stop
This commit is contained in:
parent
0bcf453de9
commit
13d20b54f2
@ -1087,7 +1087,7 @@ namespace {
|
|||||||
#define PTHREAD_ERRNO(x) { int tmpState = (x); if (isPthreadError(tmpState, #x)) return tmpState; }
|
#define PTHREAD_ERRNO(x) { int tmpState = (x); if (isPthreadError(tmpState, #x)) return tmpState; }
|
||||||
#define LOG_PTHREAD_ERROR(x) isPthreadError((x), #x)
|
#define LOG_PTHREAD_ERROR(x) isPthreadError((x), #x)
|
||||||
#define PTHREAD_ERR_STATUS(x, v) { int tmpState = (x); if (tmpState) { error(v, #x, tmpState); return false; } }
|
#define PTHREAD_ERR_STATUS(x, v) { int tmpState = (x); if (tmpState) { error(v, #x, tmpState); return false; } }
|
||||||
#define PTHREAD_ERR_RAISE(x) { int tmpState = (x); if (tmpState) { system_call_failed(#x, tmpState); } }
|
#define PTHREAD_ERR_RAISE(x) { int tmpState = (x); if (tmpState) { system_call_failed::raise(#x, tmpState); } }
|
||||||
|
|
||||||
#endif // USE_SHARED_FUTEX
|
#endif // USE_SHARED_FUTEX
|
||||||
|
|
||||||
@ -2025,7 +2025,7 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
|
|||||||
#ifdef BUGGY_LINUX_MUTEX
|
#ifdef BUGGY_LINUX_MUTEX
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif // HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
|
||||||
|
|
||||||
#ifdef USE_ROBUST_MUTEX
|
#ifdef USE_ROBUST_MUTEX
|
||||||
#ifdef BUGGY_LINUX_MUTEX
|
#ifdef BUGGY_LINUX_MUTEX
|
||||||
|
@ -144,6 +144,8 @@ void ConfigStorage::shutdown()
|
|||||||
if (!m_timer)
|
if (!m_timer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
MutexLockGuard localGuard(m_localMutex, FB_FUNCTION);
|
||||||
|
|
||||||
m_timer->stop();
|
m_timer->stop();
|
||||||
m_timer = NULL;
|
m_timer = NULL;
|
||||||
|
|
||||||
@ -290,6 +292,9 @@ void ConfigStorage::checkFile()
|
|||||||
|
|
||||||
void ConfigStorage::acquire()
|
void ConfigStorage::acquire()
|
||||||
{
|
{
|
||||||
|
if (!m_sharedMemory)
|
||||||
|
(Arg::Gds(isc_random) << "Trace shared memory can not be accessed").raise();
|
||||||
|
|
||||||
fb_assert(m_recursive >= 0);
|
fb_assert(m_recursive >= 0);
|
||||||
const ThreadId currTID = getThreadId();
|
const ThreadId currTID = getThreadId();
|
||||||
|
|
||||||
@ -309,6 +314,8 @@ void ConfigStorage::acquire()
|
|||||||
|
|
||||||
void ConfigStorage::release()
|
void ConfigStorage::release()
|
||||||
{
|
{
|
||||||
|
fb_assert(m_sharedMemory);
|
||||||
|
|
||||||
fb_assert(m_recursive > 0);
|
fb_assert(m_recursive > 0);
|
||||||
fb_assert(m_mutexTID == getThreadId());
|
fb_assert(m_mutexTID == getThreadId());
|
||||||
|
|
||||||
|
@ -67,6 +67,9 @@ public:
|
|||||||
void release();
|
void release();
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
|
Firebird::Mutex m_localMutex;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void mutexBug(int osErrorCode, const char* text);
|
void mutexBug(int osErrorCode, const char* text);
|
||||||
bool initialize(Firebird::SharedMemoryBase*, bool);
|
bool initialize(Firebird::SharedMemoryBase*, bool);
|
||||||
@ -163,12 +166,11 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class StorageGuard : public Firebird::MutexLockGuard
|
||||||
class StorageGuard
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit StorageGuard(ConfigStorage* storage) :
|
explicit StorageGuard(ConfigStorage* storage) :
|
||||||
m_storage(storage)
|
Firebird::MutexLockGuard(storage->m_localMutex, FB_FUNCTION), m_storage(storage)
|
||||||
{
|
{
|
||||||
m_storage->acquire();
|
m_storage->acquire();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user