mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 10:43:03 +01:00
Fixed CORE-4211: Embedded engine hangs for 5 seconds when closing
This commit is contained in:
parent
edd2f6945b
commit
a3abde8118
@ -47,8 +47,9 @@ class InstanceControl
|
||||
public:
|
||||
enum DtorPriority
|
||||
{
|
||||
STARTING_PRIORITY,
|
||||
STARTING_PRIORITY, // Not to be used out of class InstanceControl
|
||||
PRIORITY_DETECT_UNLOAD,
|
||||
PRIORITY_DELETE_FIRST,
|
||||
PRIORITY_REGULAR,
|
||||
PRIORITY_TLS_KEY
|
||||
};
|
||||
|
@ -125,23 +125,22 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class StorageInstance : private Firebird::InstanceControl
|
||||
class StorageInstance
|
||||
{
|
||||
private:
|
||||
Firebird::Mutex initMtx;
|
||||
ConfigStorage* storage;
|
||||
|
||||
public:
|
||||
void dtor()
|
||||
{
|
||||
delete storage;
|
||||
storage = 0;
|
||||
}
|
||||
|
||||
StorageInstance() :
|
||||
StorageInstance(Firebird::MemoryPool&) :
|
||||
storage(NULL)
|
||||
{}
|
||||
|
||||
~StorageInstance()
|
||||
{
|
||||
delete storage;
|
||||
}
|
||||
|
||||
ConfigStorage* getStorage()
|
||||
{
|
||||
if (!storage)
|
||||
@ -150,7 +149,6 @@ public:
|
||||
if (!storage)
|
||||
{
|
||||
storage = new ConfigStorage;
|
||||
new Firebird::InstanceControl::InstanceLink<StorageInstance>(this);
|
||||
}
|
||||
}
|
||||
return storage;
|
||||
|
@ -70,7 +70,7 @@ namespace
|
||||
|
||||
namespace Jrd {
|
||||
|
||||
StorageInstance TraceManager::storageInstance;
|
||||
GlobalPtr<StorageInstance, InstanceControl::PRIORITY_DELETE_FIRST> TraceManager::storageInstance;
|
||||
TraceManager::Factories* TraceManager::factories = NULL;
|
||||
GlobalPtr<Mutex> TraceManager::init_factories_mtx;
|
||||
volatile bool TraceManager::init_factories;
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
~TraceManager();
|
||||
|
||||
static ConfigStorage* getStorage()
|
||||
{ return storageInstance.getStorage(); }
|
||||
{ return storageInstance->getStorage(); }
|
||||
|
||||
static size_t pluginsCount()
|
||||
{ return factories->getCount(); }
|
||||
@ -223,7 +223,7 @@ private:
|
||||
TraceSQLStatement* statement,
|
||||
bool started, ntrace_result_t req_result);
|
||||
|
||||
static StorageInstance storageInstance;
|
||||
static Firebird::GlobalPtr<StorageInstance, Firebird::InstanceControl::PRIORITY_DELETE_FIRST> storageInstance;
|
||||
|
||||
ULONG changeNumber;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user