8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 08:03:03 +01:00
This commit is contained in:
robocop 2010-02-08 07:57:33 +00:00
parent 31f1ec8d70
commit 7ffc4d001f
3 changed files with 17 additions and 11 deletions

View File

@ -125,7 +125,7 @@ public:
// This means - for objects with ctors/dtors that want to be global,
// provide ctor with MemoryPool& parameter. Even if it is ignored!
instance = FB_NEW(*getDefaultMemoryPool()) T(*getDefaultMemoryPool());
// Put ourself into linked list for cleanup.
// Put ourselves into linked list for cleanup.
// Allocated pointer is saved by InstanceList::constructor.
new InstanceControl::InstanceLink<GlobalPtr>(this);
}
@ -156,9 +156,11 @@ public:
: flag(false) { }
void init()
{
if (!flag) {
if (!flag)
{
MutexLockGuard guard(*StaticMutex::mutex);
if (!flag) {
if (!flag)
{
C::init();
flag = true;
}
@ -166,9 +168,11 @@ public:
}
void cleanup()
{
if (flag) {
if (flag)
{
MutexLockGuard guard(*StaticMutex::mutex);
if (flag) {
if (flag)
{
C::cleanup();
flag = false;
}
@ -192,12 +196,14 @@ public:
T& operator()()
{
if (!flag) {
if (!flag)
{
MutexLockGuard guard(*StaticMutex::mutex);
if (!flag) {
if (!flag)
{
instance = FB_NEW(*getDefaultMemoryPool()) T(*getDefaultMemoryPool());
flag = true;
// Put ourself into linked list for cleanup.
// Put ourselves into linked list for cleanup.
// Allocated pointer is saved by InstanceList::constructor.
new InstanceControl::InstanceLink<InitInstance>(this);
}

View File

@ -5563,7 +5563,7 @@ namespace
class InitList : public HalfStaticArray<Auth::ClientPlugin*, 8>
{
public:
InitList(MemoryPool& p)
explicit InitList(MemoryPool& p)
: HalfStaticArray<Auth::ClientPlugin*, 8>(p)
{
// this code will be replaced with known plugins scan

View File

@ -219,7 +219,7 @@ GlobalPtr<FailedLogins> remoteFailedLogins;
class InitList : public HalfStaticArray<Auth::ServerPlugin*, 8>
{
public:
InitList(MemoryPool& p)
explicit InitList(MemoryPool& p)
: HalfStaticArray<Auth::ServerPlugin*, 8>(p)
{
PathName authMethod(Config::getAuthMethod());