mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:43:03 +01:00
Fixed CORE-3935 and CORE-3993
This commit is contained in:
parent
450f670d79
commit
74938ad13e
@ -261,7 +261,8 @@ VULCAN_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(VULCAN_Source
|
|||||||
FBCOMMON_ClientFiles = fb_exception.cpp thd.cpp classes/MetaName.cpp StatusHolder.cpp classes/init.cpp StatusArg.cpp
|
FBCOMMON_ClientFiles = fb_exception.cpp thd.cpp classes/MetaName.cpp StatusHolder.cpp classes/init.cpp StatusArg.cpp
|
||||||
FBCOMMON_ServerFiles = utils.cpp
|
FBCOMMON_ServerFiles = utils.cpp
|
||||||
|
|
||||||
FBCOMMON_ClientObjects = $(addprefix $(OBJ)/common/, $(addsuffix .o, $(basename $(FBCOMMON_ClientFiles))))
|
FBCOMMON_ClientObjects = $(addprefix $(OBJ)/common/, $(addsuffix .o, $(basename $(FBCOMMON_ClientFiles)))) \
|
||||||
|
$(addprefix $(OBJ)/jrd/, $(addsuffix .o, $(basename fbsyslog.cpp)))
|
||||||
FBCOMMON_ServerObjects = $(addprefix $(OBJ)/common/, $(addsuffix .o, $(basename $(FBCOMMON_ServerFiles))))
|
FBCOMMON_ServerObjects = $(addprefix $(OBJ)/common/, $(addsuffix .o, $(basename $(FBCOMMON_ServerFiles))))
|
||||||
|
|
||||||
FBCOMMON_Objects = $(FBCOMMON_ClientObjects) $(FBCOMMON_ServerObjects)
|
FBCOMMON_Objects = $(FBCOMMON_ClientObjects) $(FBCOMMON_ServerObjects)
|
||||||
@ -284,7 +285,7 @@ CLUMPLETS_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(CLUMPLETS_
|
|||||||
# Platform Manager
|
# Platform Manager
|
||||||
|
|
||||||
# just in case if make.platform defined some files
|
# just in case if make.platform defined some files
|
||||||
OS_SPECIFIC_Files += config_root.cpp path_utils.cpp mod_loader.cpp fbsyslog.cpp guid.cpp os_utils.cpp
|
OS_SPECIFIC_Files += config_root.cpp path_utils.cpp mod_loader.cpp guid.cpp os_utils.cpp
|
||||||
|
|
||||||
OS_SPECIFIC_Sources = $(addprefix jrd/, $(OS_SPECIFIC_Files)) common/dllinst.cpp
|
OS_SPECIFIC_Sources = $(addprefix jrd/, $(OS_SPECIFIC_Files)) common/dllinst.cpp
|
||||||
ifneq ($(strip @BINRELOC_CFLAGS@),)
|
ifneq ($(strip @BINRELOC_CFLAGS@),)
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
|
#include "gen/iberror.h"
|
||||||
#include "../jrd/gdsassert.h"
|
#include "../jrd/gdsassert.h"
|
||||||
#include "rwlock.h"
|
#include "rwlock.h"
|
||||||
#include "PublicHandle.h"
|
#include "PublicHandle.h"
|
||||||
@ -31,6 +32,7 @@ namespace Firebird
|
|||||||
GlobalPtr<RWLock> PublicHandle::sync;
|
GlobalPtr<RWLock> PublicHandle::sync;
|
||||||
|
|
||||||
PublicHandle::PublicHandle()
|
PublicHandle::PublicHandle()
|
||||||
|
: RefPtr<ExistenceMutex>(FB_NEW(*getDefaultMemoryPool()) ExistenceMutex)
|
||||||
{
|
{
|
||||||
WriteLockGuard guard(sync);
|
WriteLockGuard guard(sync);
|
||||||
|
|
||||||
@ -48,6 +50,8 @@ namespace Firebird
|
|||||||
{
|
{
|
||||||
WriteLockGuard guard(sync);
|
WriteLockGuard guard(sync);
|
||||||
|
|
||||||
|
mutex()->objectExists = false;
|
||||||
|
|
||||||
size_t pos;
|
size_t pos;
|
||||||
if (handles->find(this, pos))
|
if (handles->find(this, pos))
|
||||||
{
|
{
|
||||||
@ -59,15 +63,82 @@ namespace Firebird
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PublicHandle::isKnownHandle() const
|
ExistenceMutex* PublicHandle::isKnownHandle() const
|
||||||
{
|
{
|
||||||
if (!this)
|
if (!this)
|
||||||
{
|
{
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadLockGuard guard(sync);
|
ReadLockGuard guard(sync);
|
||||||
return handles->exist(this);
|
if (handles->exist(this))
|
||||||
|
{
|
||||||
|
mutex()->addRef();
|
||||||
|
return mutex();
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
bool PublicHandle::executeWithLock(ExecuteWithLock* operation)
|
||||||
|
{
|
||||||
|
ReadLockGuard guard(sync);
|
||||||
|
if (handles->exist(this))
|
||||||
|
{
|
||||||
|
operation->execute();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
PublicHandleHolder::PublicHandleHolder()
|
||||||
|
: mutex(NULL)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
PublicHandleHolder::PublicHandleHolder(PublicHandle* handle, const char* from)
|
||||||
|
: mutex(NULL)
|
||||||
|
{
|
||||||
|
if (!hold(handle, from))
|
||||||
|
{
|
||||||
|
fb_assert(false);
|
||||||
|
(Arg::Gds(isc_random) << "Public object unexpectedly lost").raise();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PublicHandleHolder::hold(PublicHandle* handle, const char* from)
|
||||||
|
{
|
||||||
|
mutex = handle->isKnownHandle();
|
||||||
|
if (mutex)
|
||||||
|
{
|
||||||
|
mutex->enter(from);
|
||||||
|
if (mutex->objectExists)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
destroy();
|
||||||
|
mutex = NULL;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
PublicHandleHolder::~PublicHandleHolder()
|
||||||
|
{
|
||||||
|
if (mutex)
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PublicHandleHolder::destroy()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mutex->leave();
|
||||||
|
}
|
||||||
|
catch (const Firebird::Exception&)
|
||||||
|
{
|
||||||
|
DtorException::devHalt();
|
||||||
|
}
|
||||||
|
mutex->release();
|
||||||
|
}
|
||||||
|
} // namespace Firebird
|
||||||
|
@ -25,24 +25,60 @@
|
|||||||
|
|
||||||
#include "../common/classes/init.h"
|
#include "../common/classes/init.h"
|
||||||
#include "../common/classes/array.h"
|
#include "../common/classes/array.h"
|
||||||
|
#include "../common/classes/RefMutex.h"
|
||||||
|
|
||||||
namespace Firebird
|
namespace Firebird
|
||||||
{
|
{
|
||||||
class RWLock;
|
class RWLock;
|
||||||
|
|
||||||
class PublicHandle
|
class ExecuteWithLock
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void execute() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ExistenceMutex : public RefMutex
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool objectExists;
|
||||||
|
|
||||||
|
ExistenceMutex()
|
||||||
|
: RefMutex(), objectExists(true)
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
|
class PublicHandle : public RefPtr<ExistenceMutex>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PublicHandle();
|
PublicHandle();
|
||||||
~PublicHandle();
|
~PublicHandle();
|
||||||
|
|
||||||
bool isKnownHandle() const;
|
ExistenceMutex* isKnownHandle() const;
|
||||||
|
ExistenceMutex* mutex() const
|
||||||
|
{
|
||||||
|
return (ExistenceMutex*)(*const_cast<PublicHandle*>(this));
|
||||||
|
}
|
||||||
|
bool executeWithLock(ExecuteWithLock* operation);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static GlobalPtr<Array<const void*> > handles;
|
static GlobalPtr<Array<const void*> > handles;
|
||||||
static GlobalPtr<RWLock> sync;
|
static GlobalPtr<RWLock> sync;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PublicHandleHolder
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PublicHandleHolder();
|
||||||
|
PublicHandleHolder(PublicHandle*, const char* from);
|
||||||
|
~PublicHandleHolder();
|
||||||
|
|
||||||
|
bool hold(PublicHandle* handle, const char* from);
|
||||||
|
|
||||||
|
private:
|
||||||
|
ExistenceMutex* mutex;
|
||||||
|
void destroy();
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#endif // COMMON_PUBLIC_HANDLE
|
#endif // COMMON_PUBLIC_HANDLE
|
||||||
|
@ -46,14 +46,20 @@ namespace Firebird
|
|||||||
RefMutex() {}
|
RefMutex() {}
|
||||||
explicit RefMutex(MemoryPool& pool) : mutex(pool) {}
|
explicit RefMutex(MemoryPool& pool) : mutex(pool) {}
|
||||||
|
|
||||||
void enter()
|
void enter(const char* f)
|
||||||
{
|
{
|
||||||
mutex.enter();
|
mutex.enter();
|
||||||
|
setFrom(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tryEnter()
|
bool tryEnter(const char* f)
|
||||||
{
|
{
|
||||||
return mutex.tryEnter();
|
bool rc = mutex.tryEnter();
|
||||||
|
if (rc)
|
||||||
|
{
|
||||||
|
setFrom(f);
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void leave()
|
void leave()
|
||||||
@ -63,16 +69,27 @@ namespace Firebird
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
const char* from[8];
|
||||||
|
unsigned frIndex;
|
||||||
|
void setFrom(const char* fr)
|
||||||
|
{
|
||||||
|
frIndex %= FB_NELEM(from);
|
||||||
|
from[frIndex++] = fr;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void setFrom(const char*) { }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// RAII holder
|
// RAII holder
|
||||||
class RefMutexGuard : public Reference
|
class RefMutexGuard : public Reference
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RefMutexGuard(RefMutex& alock)
|
RefMutexGuard(RefMutex& alock, const char* f)
|
||||||
: Reference(alock), lock(&alock)
|
: Reference(alock), lock(&alock)
|
||||||
{
|
{
|
||||||
lock->enter();
|
lock->enter(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
~RefMutexGuard()
|
~RefMutexGuard()
|
||||||
@ -102,6 +119,16 @@ namespace Firebird
|
|||||||
{
|
{
|
||||||
return object->release();
|
return object->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void enter(T* object, const char* f)
|
||||||
|
{
|
||||||
|
object->enter(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool tryEnter(T* object, const char* f)
|
||||||
|
{
|
||||||
|
return object->tryEnter(f);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -117,6 +144,16 @@ namespace Firebird
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void enter(T* object, const char*)
|
||||||
|
{
|
||||||
|
object->enter();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool tryEnter(T* object, const char*)
|
||||||
|
{
|
||||||
|
return object->tryEnter();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Mtx, typename RefCounted = DefaultRefCounted<Mtx> >
|
template <typename Mtx, typename RefCounted = DefaultRefCounted<Mtx> >
|
||||||
@ -124,10 +161,9 @@ namespace Firebird
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit EnsureUnlock(Mtx& mutex)
|
explicit EnsureUnlock(Mtx& mutex)
|
||||||
|
: m_mutex(&mutex), m_locked(0)
|
||||||
{
|
{
|
||||||
m_mutex = &mutex;
|
|
||||||
RefCounted::addRef(m_mutex);
|
RefCounted::addRef(m_mutex);
|
||||||
m_locked = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~EnsureUnlock()
|
~EnsureUnlock()
|
||||||
@ -139,13 +175,13 @@ namespace Firebird
|
|||||||
|
|
||||||
void enter()
|
void enter()
|
||||||
{
|
{
|
||||||
m_mutex->enter();
|
RefCounted::enter(m_mutex, "EnsureUnlock");
|
||||||
m_locked++;
|
m_locked++;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tryEnter()
|
bool tryEnter()
|
||||||
{
|
{
|
||||||
if (m_mutex->tryEnter())
|
if (RefCounted::tryEnter(m_mutex, "EnsureUnlock::tryEnter"))
|
||||||
{
|
{
|
||||||
m_locked++;
|
m_locked++;
|
||||||
return true;
|
return true;
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "../common/classes/init.h"
|
#include "../common/classes/init.h"
|
||||||
#include "../jrd/constants.h"
|
#include "../jrd/constants.h"
|
||||||
#include "../jrd/os/path_utils.h"
|
#include "../jrd/os/path_utils.h"
|
||||||
|
#include "../jrd/os/fbsyslog.h"
|
||||||
|
|
||||||
#ifdef WIN_NT
|
#ifdef WIN_NT
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
@ -1016,4 +1017,15 @@ Firebird::PathName getPrefix(FB_DIR prefType, const char* name)
|
|||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void logAndDie(const char* text)
|
||||||
|
{
|
||||||
|
gds__log(text);
|
||||||
|
Firebird::Syslog::Record(Firebird::Syslog::Error, text);
|
||||||
|
#ifdef WIN_NT
|
||||||
|
exit(3);
|
||||||
|
#else
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fb_utils
|
} // namespace fb_utils
|
||||||
|
@ -137,6 +137,8 @@ namespace fb_utils
|
|||||||
// Add appropriate file prefix.
|
// Add appropriate file prefix.
|
||||||
Firebird::PathName getPrefix(FB_DIR prefType, const char* name);
|
Firebird::PathName getPrefix(FB_DIR prefType, const char* name);
|
||||||
|
|
||||||
|
void logAndDie(const char* text);
|
||||||
|
|
||||||
} // namespace fb_utils
|
} // namespace fb_utils
|
||||||
|
|
||||||
#endif // INCLUDE_UTILS_PROTO_H
|
#endif // INCLUDE_UTILS_PROTO_H
|
||||||
|
@ -91,7 +91,7 @@ namespace Jrd
|
|||||||
delete dbb_monitoring_data;
|
delete dbb_monitoring_data;
|
||||||
delete dbb_backup_manager;
|
delete dbb_backup_manager;
|
||||||
|
|
||||||
Checkout dcoHolder(this);
|
fb_assert(!locked());
|
||||||
// This line decrements the usage counter and may cause the destructor to be called.
|
// This line decrements the usage counter and may cause the destructor to be called.
|
||||||
// It should happen with the dbb_sync unlocked.
|
// It should happen with the dbb_sync unlocked.
|
||||||
LockManager::destroy(dbb_lock_mgr);
|
LockManager::destroy(dbb_lock_mgr);
|
||||||
@ -102,6 +102,8 @@ namespace Jrd
|
|||||||
{
|
{
|
||||||
if (pool)
|
if (pool)
|
||||||
{
|
{
|
||||||
|
fb_assert(locked() || dbb_flags & DBB_not_in_use);
|
||||||
|
|
||||||
size_t pos;
|
size_t pos;
|
||||||
if (dbb_pools.find(pool, pos))
|
if (dbb_pools.find(pool, pos))
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ const ULONG DBB_lck_init_done = 0x1000L; // LCK_init() called for the database
|
|||||||
const ULONG DBB_sweep_in_progress = 0x2000L; // A database sweep operation is in progress
|
const ULONG DBB_sweep_in_progress = 0x2000L; // A database sweep operation is in progress
|
||||||
const ULONG DBB_security_db = 0x4000L; // ISC security database
|
const ULONG DBB_security_db = 0x4000L; // ISC security database
|
||||||
const ULONG DBB_suspend_bgio = 0x8000L; // Suspend I/O by background threads
|
const ULONG DBB_suspend_bgio = 0x8000L; // Suspend I/O by background threads
|
||||||
const ULONG DBB_being_opened = 0x10000L; // database is being attached to
|
const ULONG DBB_new = 0x10000L; // Database object is just created
|
||||||
const ULONG DBB_gc_cooperative = 0x20000L; // cooperative garbage collection
|
const ULONG DBB_gc_cooperative = 0x20000L; // cooperative garbage collection
|
||||||
const ULONG DBB_gc_background = 0x40000L; // background garbage collection by gc_thread
|
const ULONG DBB_gc_background = 0x40000L; // background garbage collection by gc_thread
|
||||||
const ULONG DBB_no_fs_cache = 0x80000L; // Not using file system cache
|
const ULONG DBB_no_fs_cache = 0x80000L; // Not using file system cache
|
||||||
@ -129,6 +129,9 @@ class Database : public pool_alloc<type_dbb>, public Firebird::PublicHandle
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sync() : threadId(0), isAst(false)
|
Sync() : threadId(0), isAst(false)
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
, lockCount(0)
|
||||||
|
#endif
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void lock(bool ast = false)
|
void lock(bool ast = false)
|
||||||
@ -139,6 +142,9 @@ class Database : public pool_alloc<type_dbb>, public Firebird::PublicHandle
|
|||||||
--waiters;
|
--waiters;
|
||||||
threadId = getThreadId();
|
threadId = getThreadId();
|
||||||
isAst = ast;
|
isAst = ast;
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
++lockCount;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void unlock()
|
void unlock()
|
||||||
@ -146,6 +152,10 @@ class Database : public pool_alloc<type_dbb>, public Firebird::PublicHandle
|
|||||||
ThreadPriorityScheduler::exit();
|
ThreadPriorityScheduler::exit();
|
||||||
isAst = false;
|
isAst = false;
|
||||||
threadId = 0;
|
threadId = 0;
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
fb_assert(lockCount > 0);
|
||||||
|
--lockCount;
|
||||||
|
#endif
|
||||||
syncMutex.leave();
|
syncMutex.leave();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +164,17 @@ class Database : public pool_alloc<type_dbb>, public Firebird::PublicHandle
|
|||||||
return (waiters.value() > 0);
|
return (waiters.value() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
bool locked() const
|
||||||
|
{
|
||||||
|
if (!syncMutex.tryEnter())
|
||||||
|
return false;
|
||||||
|
bool rc = lockCount > 0;
|
||||||
|
syncMutex.leave();
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~Sync()
|
~Sync()
|
||||||
{
|
{
|
||||||
@ -167,10 +188,16 @@ class Database : public pool_alloc<type_dbb>, public Firebird::PublicHandle
|
|||||||
Sync(const Sync&);
|
Sync(const Sync&);
|
||||||
Sync& operator=(const Sync&);
|
Sync& operator=(const Sync&);
|
||||||
|
|
||||||
Firebird::Mutex syncMutex;
|
#ifdef DEV_BUILD
|
||||||
|
mutable
|
||||||
|
#endif
|
||||||
|
Firebird::Mutex syncMutex;
|
||||||
Firebird::AtomicCounter waiters;
|
Firebird::AtomicCounter waiters;
|
||||||
FB_THREAD_ID threadId;
|
FB_THREAD_ID threadId;
|
||||||
bool isAst;
|
bool isAst;
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
int lockCount;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -357,6 +384,7 @@ public:
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
mutex()->release();
|
||||||
|
|
||||||
return TypedHandle<type_dbb>::checkHandle();
|
return TypedHandle<type_dbb>::checkHandle();
|
||||||
}
|
}
|
||||||
@ -486,6 +514,9 @@ public:
|
|||||||
MemoryPool* createPool()
|
MemoryPool* createPool()
|
||||||
{
|
{
|
||||||
MemoryPool* const pool = MemoryPool::createPool(dbb_permanent, dbb_memory_stats);
|
MemoryPool* const pool = MemoryPool::createPool(dbb_permanent, dbb_memory_stats);
|
||||||
|
|
||||||
|
fb_assert(locked() || dbb_flags & DBB_new);
|
||||||
|
|
||||||
dbb_pools.add(pool);
|
dbb_pools.add(pool);
|
||||||
return pool;
|
return pool;
|
||||||
}
|
}
|
||||||
@ -539,6 +570,13 @@ public:
|
|||||||
return dbb_shared_counter.generate(tdbb, SharedCounter::STATEMENT_ID_SPACE);
|
return dbb_shared_counter.generate(tdbb, SharedCounter::STATEMENT_ID_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
bool locked() const
|
||||||
|
{
|
||||||
|
return dbb_sync->locked();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// The delete operators are no-oped because the Database memory is allocated from the
|
// The delete operators are no-oped because the Database memory is allocated from the
|
||||||
|
@ -288,10 +288,7 @@ void DatabaseSnapshot::SharedData::checkMutex(const TEXT* string, int state)
|
|||||||
TEXT msg[BUFFER_TINY];
|
TEXT msg[BUFFER_TINY];
|
||||||
|
|
||||||
sprintf(msg, "MONITOR: mutex %s error, status = %d", string, state);
|
sprintf(msg, "MONITOR: mutex %s error, status = %d", string, state);
|
||||||
gds__log(msg);
|
fb_utils::logAndDie(msg);
|
||||||
|
|
||||||
//fprintf(stderr, "%s\n", msg);
|
|
||||||
exit(FINI_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,9 +439,12 @@ int CCH_down_grade_dbb(void* ast_object)
|
|||||||
if (lock->lck_physical == LCK_EX) {
|
if (lock->lck_physical == LCK_EX) {
|
||||||
LCK_convert(tdbb, lock, LCK_PW, LCK_WAIT); // This lets waiting cache manager in first
|
LCK_convert(tdbb, lock, LCK_PW, LCK_WAIT); // This lets waiting cache manager in first
|
||||||
}
|
}
|
||||||
else {
|
else if (lock->lck_physical == LCK_PW) {
|
||||||
LCK_convert(tdbb, lock, LCK_SW, LCK_WAIT);
|
LCK_convert(tdbb, lock, LCK_SW, LCK_WAIT);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
fb_assert(lock->lck_physical == 0);
|
||||||
|
}
|
||||||
|
|
||||||
dbb->dbb_ast_flags &= ~DBB_blocking;
|
dbb->dbb_ast_flags &= ~DBB_blocking;
|
||||||
}
|
}
|
||||||
@ -631,7 +634,7 @@ bool CCH_exclusive_attachment(thread_db* tdbb, USHORT level, SSHORT wait_flag)
|
|||||||
THREAD_SLEEP(CCH_EXCLUSIVE_RETRY_INTERVAL * 1000);
|
THREAD_SLEEP(CCH_EXCLUSIVE_RETRY_INTERVAL * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdbb->getAttachment()->att_flags & ATT_cancel_raise)
|
if (tdbb->getAttachment()->cancelRaise())
|
||||||
{
|
{
|
||||||
if (JRD_reschedule(tdbb, 0, false))
|
if (JRD_reschedule(tdbb, 0, false))
|
||||||
{
|
{
|
||||||
@ -4023,6 +4026,8 @@ static THREAD_ENTRY_DECLARE cache_reader(THREAD_ENTRY_PARAM arg)
|
|||||||
Attachment* const attachment = Attachment::create(dbb);
|
Attachment* const attachment = Attachment::create(dbb);
|
||||||
tdbb->setAttachment(attachment);
|
tdbb->setAttachment(attachment);
|
||||||
attachment->att_filename = dbb->dbb_filename;
|
attachment->att_filename = dbb->dbb_filename;
|
||||||
|
|
||||||
|
PublicHandleHolder attHolder(attachment, "cache_reader()");
|
||||||
Jrd::ContextPoolHolder context(tdbb, dbb->dbb_bufferpool);
|
Jrd::ContextPoolHolder context(tdbb, dbb->dbb_bufferpool);
|
||||||
|
|
||||||
// This try block is specifically to protect the LCK_init call: if
|
// This try block is specifically to protect the LCK_init call: if
|
||||||
@ -4185,6 +4190,7 @@ static THREAD_ENTRY_DECLARE cache_writer(THREAD_ENTRY_PARAM arg)
|
|||||||
Attachment* const attachment = Attachment::create(dbb);
|
Attachment* const attachment = Attachment::create(dbb);
|
||||||
tdbb->setAttachment(attachment);
|
tdbb->setAttachment(attachment);
|
||||||
attachment->att_filename = dbb->dbb_filename;
|
attachment->att_filename = dbb->dbb_filename;
|
||||||
|
PublicHandleHolder attHolder(attachment, "cache_writer()");
|
||||||
Jrd::ContextPoolHolder context(tdbb, dbb->dbb_bufferpool);
|
Jrd::ContextPoolHolder context(tdbb, dbb->dbb_bufferpool);
|
||||||
|
|
||||||
// This try block is specifically to protect the LCK_init call: if
|
// This try block is specifically to protect the LCK_init call: if
|
||||||
|
@ -598,8 +598,7 @@ evh* EventManager::acquire_shmem()
|
|||||||
if (!header)
|
if (!header)
|
||||||
{
|
{
|
||||||
release_shmem();
|
release_shmem();
|
||||||
gds__log("Event table remap failed");
|
fb_utils::logAndDie("Event table remap failed");
|
||||||
exit(FINI_ERROR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_header = header;
|
m_header = header;
|
||||||
@ -671,8 +670,7 @@ frb* EventManager::alloc_global(UCHAR type, ULONG length, bool recurse)
|
|||||||
if (!best)
|
if (!best)
|
||||||
{
|
{
|
||||||
release_shmem();
|
release_shmem();
|
||||||
gds__log("Event table space exhausted");
|
fb_utils::logAndDie("Event table space exhausted");
|
||||||
exit(FINI_ERROR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free = (frb*) SRQ_ABS_PTR(*best);
|
free = (frb*) SRQ_ABS_PTR(*best);
|
||||||
@ -1244,10 +1242,7 @@ void EventManager::mutex_bugcheck(const TEXT* string, int mutex_state)
|
|||||||
TEXT msg[BUFFER_TINY];
|
TEXT msg[BUFFER_TINY];
|
||||||
|
|
||||||
sprintf(msg, "EVENT: %s error, status = %d", string, mutex_state);
|
sprintf(msg, "EVENT: %s error, status = %d", string, mutex_state);
|
||||||
gds__log(msg);
|
fb_utils::logAndDie(msg);
|
||||||
|
|
||||||
fprintf(stderr, "%s\n", msg);
|
|
||||||
exit(FINI_ERROR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@
|
|||||||
#include "../common/config/config.h"
|
#include "../common/config/config.h"
|
||||||
#include "../common/utils_proto.h"
|
#include "../common/utils_proto.h"
|
||||||
#include "../common/StatusArg.h"
|
#include "../common/StatusArg.h"
|
||||||
#include "../common/classes/RefMutex.h"
|
|
||||||
|
|
||||||
static int process_id;
|
static int process_id;
|
||||||
|
|
||||||
|
1427
src/jrd/jrd.cpp
1427
src/jrd/jrd.cpp
File diff suppressed because it is too large
Load Diff
@ -105,7 +105,7 @@ namespace Jrd {
|
|||||||
|
|
||||||
const int QUANTUM = 100; // Default quantum
|
const int QUANTUM = 100; // Default quantum
|
||||||
const int SWEEP_QUANTUM = 10; // Make sweeps less disruptive
|
const int SWEEP_QUANTUM = 10; // Make sweeps less disruptive
|
||||||
const int MAX_CALLBACKS = 50;
|
const ULONG MAX_CALLBACKS = 50;
|
||||||
|
|
||||||
// fwd. decl.
|
// fwd. decl.
|
||||||
class thread_db;
|
class thread_db;
|
||||||
@ -251,18 +251,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void destroy(Attachment* const attachment)
|
static void destroy(Attachment* const attachment);
|
||||||
{
|
|
||||||
if (attachment)
|
|
||||||
{
|
|
||||||
Database* const dbb = attachment->att_database;
|
|
||||||
MemoryPool* const pool = attachment->att_pool;
|
|
||||||
Firebird::MemoryStats temp_stats;
|
|
||||||
pool->setStatsGroup(temp_stats);
|
|
||||||
delete attachment;
|
|
||||||
dbb->deletePool(pool);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Attachment()
|
/* Attachment()
|
||||||
: att_database(0),
|
: att_database(0),
|
||||||
@ -333,7 +322,6 @@ public:
|
|||||||
DSqlCache att_dsql_cache; // DSQL cache locks
|
DSqlCache att_dsql_cache; // DSQL cache locks
|
||||||
Firebird::SortedArray<void*> att_udf_pointers;
|
Firebird::SortedArray<void*> att_udf_pointers;
|
||||||
dsql_dbb* att_dsql_instance;
|
dsql_dbb* att_dsql_instance;
|
||||||
Firebird::Mutex att_mutex; // attachment mutex
|
|
||||||
|
|
||||||
EDS::Connection* att_ext_connection; // external connection executed by this attachment
|
EDS::Connection* att_ext_connection; // external connection executed by this attachment
|
||||||
ULONG att_ext_call_depth; // external connection call depth, 0 for user attachment
|
ULONG att_ext_call_depth; // external connection call depth, 0 for user attachment
|
||||||
@ -353,15 +341,7 @@ public:
|
|||||||
bool backupStateReadLock(thread_db* tdbb, SSHORT wait);
|
bool backupStateReadLock(thread_db* tdbb, SSHORT wait);
|
||||||
void backupStateReadUnLock(thread_db* tdbb);
|
void backupStateReadUnLock(thread_db* tdbb);
|
||||||
|
|
||||||
bool checkHandle() const
|
bool cancelRaise();
|
||||||
{
|
|
||||||
if (!isKnownHandle())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TypedHandle<type_att>::checkHandle();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Attachment(MemoryPool* pool, Database* dbb);
|
Attachment(MemoryPool* pool, Database* dbb);
|
||||||
@ -371,31 +351,34 @@ private:
|
|||||||
|
|
||||||
// Attachment flags
|
// Attachment flags
|
||||||
|
|
||||||
const ULONG ATT_no_cleanup = 1; // Don't expunge, purge, or garbage collect
|
const ULONG ATT_no_cleanup = 0x1; // Don't expunge, purge, or garbage collect
|
||||||
const ULONG ATT_shutdown = 2; // attachment has been shutdown
|
const ULONG ATT_shutdown = 0x2; // attachment has been shutdown
|
||||||
const ULONG ATT_purge_error = 4; // trouble happened in purge attachment, att_mutex remains locked
|
const ULONG ATT_purge_error = 0x4; // trouble happened in purge attachment
|
||||||
const ULONG ATT_shutdown_manager = 8; // attachment requesting shutdown
|
const ULONG ATT_shutdown_manager = 0x8; // attachment requesting shutdown
|
||||||
const ULONG ATT_lck_init_done = 16; // LCK_init() called for the attachment
|
const ULONG ATT_lck_init_done = 0x10; // LCK_init() called for the attachment
|
||||||
const ULONG ATT_exclusive = 32; // attachment wants exclusive database access
|
const ULONG ATT_exclusive = 0x20; // attachment wants exclusive database access
|
||||||
const ULONG ATT_attach_pending = 64; // Indicate attachment is only pending
|
const ULONG ATT_attach_pending = 0x40; // Indicate attachment is only pending
|
||||||
const ULONG ATT_exclusive_pending = 128; // Indicate exclusive attachment pending
|
const ULONG ATT_exclusive_pending = 0x80; // Indicate exclusive attachment pending
|
||||||
const ULONG ATT_gbak_attachment = 256; // Indicate GBAK attachment
|
const ULONG ATT_gbak_attachment = 0x100; // Indicate GBAK attachment
|
||||||
|
|
||||||
#ifdef GARBAGE_THREAD
|
#ifdef GARBAGE_THREAD
|
||||||
const ULONG ATT_notify_gc = 1024; // Notify garbage collector to expunge, purge ..
|
const ULONG ATT_notify_gc = 0x200; // Notify garbage collector to expunge, purge ..
|
||||||
const ULONG ATT_disable_notify_gc = 2048; // Temporarily perform own garbage collection
|
const ULONG ATT_disable_notify_gc = 0x400; // Temporarily perform own garbage collection
|
||||||
const ULONG ATT_garbage_collector = 4096; // I'm a garbage collector
|
const ULONG ATT_garbage_collector = 0x800; // I'm a garbage collector
|
||||||
|
|
||||||
const ULONG ATT_NO_CLEANUP = (ATT_no_cleanup | ATT_notify_gc);
|
const ULONG ATT_NO_CLEANUP = (ATT_no_cleanup | ATT_notify_gc);
|
||||||
#else
|
#else
|
||||||
const ULONG ATT_NO_CLEANUP = ATT_no_cleanup;
|
const ULONG ATT_NO_CLEANUP = ATT_no_cleanup;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const ULONG ATT_cancel_raise = 8192; // Cancel currently running operation
|
const ULONG ATT_cancel_raise = 0x1000; // Cancel currently running operation
|
||||||
const ULONG ATT_cancel_disable = 16384; // Disable cancel operations
|
const ULONG ATT_cancel_disable = 0x2000; // Disable cancel operations
|
||||||
const ULONG ATT_gfix_attachment = 32768; // Indicate a GFIX attachment
|
const ULONG ATT_gfix_attachment = 0x4000; // Indicate a GFIX attachment
|
||||||
const ULONG ATT_gstat_attachment = 65536; // Indicate a GSTAT attachment
|
const ULONG ATT_gstat_attachment = 0x8000; // Indicate a GSTAT attachment
|
||||||
const ULONG ATT_no_db_triggers = 131072; // Don't execute database triggers
|
const ULONG ATT_no_db_triggers = 0x10000; // Don't execute database triggers
|
||||||
|
const ULONG ATT_manual_lock = 0x20000; // Was locked manually
|
||||||
|
const ULONG ATT_terminate = 0x40000; // Terminate currently running operation
|
||||||
|
const ULONG ATT_protected = 0x80000; // Ignore termination flag when disconnecting
|
||||||
|
|
||||||
|
|
||||||
inline bool Attachment::locksmith() const
|
inline bool Attachment::locksmith() const
|
||||||
@ -403,6 +386,13 @@ inline bool Attachment::locksmith() const
|
|||||||
return att_user && att_user->locksmith();
|
return att_user && att_user->locksmith();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool Attachment::cancelRaise()
|
||||||
|
{
|
||||||
|
return att_flags & ATT_protected ? false :
|
||||||
|
att_flags & ATT_terminate ? true :
|
||||||
|
att_flags & ATT_cancel_disable ? false :
|
||||||
|
att_flags & ATT_cancel_raise ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Procedure block
|
// Procedure block
|
||||||
|
@ -170,10 +170,7 @@ void ConfigStorage::checkMutex(const TEXT* string, int state)
|
|||||||
TEXT msg[BUFFER_TINY];
|
TEXT msg[BUFFER_TINY];
|
||||||
|
|
||||||
sprintf(msg, "ConfigStorage: mutex %s error, status = %d", string, state);
|
sprintf(msg, "ConfigStorage: mutex %s error, status = %d", string, state);
|
||||||
gds__log(msg);
|
fb_utils::logAndDie(msg);
|
||||||
|
|
||||||
fprintf(stderr, "%s\n", msg);
|
|
||||||
exit(FINI_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "../../jrd/os/path_utils.h"
|
#include "../../jrd/os/path_utils.h"
|
||||||
#include "../../jrd/os/os_utils.h"
|
#include "../../jrd/os/os_utils.h"
|
||||||
#include "../../jrd/trace/TraceLog.h"
|
#include "../../jrd/trace/TraceLog.h"
|
||||||
|
#include "../common/utils_proto.h"
|
||||||
|
|
||||||
using namespace Firebird;
|
using namespace Firebird;
|
||||||
|
|
||||||
@ -242,10 +243,7 @@ void TraceLog::checkMutex(const TEXT* string, int state)
|
|||||||
TEXT msg[BUFFER_TINY];
|
TEXT msg[BUFFER_TINY];
|
||||||
|
|
||||||
sprintf(msg, "TraceLog: mutex %s error, status = %d", string, state);
|
sprintf(msg, "TraceLog: mutex %s error, status = %d", string, state);
|
||||||
gds__log(msg);
|
fb_utils::logAndDie(msg);
|
||||||
|
|
||||||
fprintf(stderr, "%s\n", msg);
|
|
||||||
exit(FINI_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4028,7 +4028,7 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg)
|
|||||||
Attachment* const attachment = Attachment::create(dbb);
|
Attachment* const attachment = Attachment::create(dbb);
|
||||||
tdbb->setAttachment(attachment);
|
tdbb->setAttachment(attachment);
|
||||||
attachment->att_filename = dbb->dbb_filename;
|
attachment->att_filename = dbb->dbb_filename;
|
||||||
attachment->att_flags = ATT_garbage_collector;
|
attachment->att_flags |= ATT_garbage_collector;
|
||||||
|
|
||||||
rpb.getWindow(tdbb).win_flags = WIN_garbage_collector;
|
rpb.getWindow(tdbb).win_flags = WIN_garbage_collector;
|
||||||
|
|
||||||
@ -4285,6 +4285,7 @@ gc_exit:
|
|||||||
Attachment* const attachment = tdbb->getAttachment();
|
Attachment* const attachment = tdbb->getAttachment();
|
||||||
if (attachment)
|
if (attachment)
|
||||||
{
|
{
|
||||||
|
PublicHandleHolder attHolder(attachment, "garbage_collector()");
|
||||||
LCK_fini(tdbb, LCK_OWNER_attachment);
|
LCK_fini(tdbb, LCK_OWNER_attachment);
|
||||||
Attachment::destroy(attachment); // no need saving warning error strings here
|
Attachment::destroy(attachment); // no need saving warning error strings here
|
||||||
tdbb->setAttachment(NULL);
|
tdbb->setAttachment(NULL);
|
||||||
|
@ -940,8 +940,7 @@ namespace
|
|||||||
{
|
{
|
||||||
strcpy(buffer, "Unknown failure in shutdown thread in shutSem:enter()");
|
strcpy(buffer, "Unknown failure in shutdown thread in shutSem:enter()");
|
||||||
}
|
}
|
||||||
gds__log("%s", buffer);
|
fb_utils::logAndDie(buffer);
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! killed)
|
if (! killed)
|
||||||
|
@ -1639,13 +1639,15 @@ void LockManager::bug(ISC_STATUS* status_vector, const TEXT* string)
|
|||||||
#else
|
#else
|
||||||
sprintf(s, "Fatal lock manager error: %s, errno: %d", string, ERRNO);
|
sprintf(s, "Fatal lock manager error: %s, errno: %d", string, ERRNO);
|
||||||
#endif
|
#endif
|
||||||
gds__log(s);
|
|
||||||
fprintf(stderr, "%s\n", s);
|
|
||||||
|
|
||||||
#if !(defined WIN_NT)
|
#if !(defined WIN_NT)
|
||||||
// The strerror() function returns the appropriate description string,
|
// The strerror() function returns the appropriate description string,
|
||||||
// or an unknown error message if the error code is unknown.
|
// or an unknown error message if the error code is unknown.
|
||||||
fprintf(stderr, "--%s\n", strerror(errno));
|
if (errno)
|
||||||
|
{
|
||||||
|
strcat(s, "\n--");
|
||||||
|
strcat(s, strerror(errno));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!m_bugcheck)
|
if (!m_bugcheck)
|
||||||
@ -1689,15 +1691,16 @@ void LockManager::bug(ISC_STATUS* status_vector, const TEXT* string)
|
|||||||
|
|
||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
/* In the worst case this code makes it possible to attach live process
|
/* In the worst case this code makes it possible to attach live process
|
||||||
* and see shared memory data.
|
* and see shared memory data. */
|
||||||
fprintf(stderr, "Attach to pid=%d\n", getpid());
|
if (isatty(2))
|
||||||
|
fprintf(stderr, "Attach to pid=%d\n", getpid());
|
||||||
|
else
|
||||||
|
gds__log("Attach to pid=%d\n", getpid());
|
||||||
sleep(120);
|
sleep(120);
|
||||||
*/
|
/**/
|
||||||
// Make a core drop - we want to LOOK at this failure!
|
|
||||||
abort();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit(FINI_ERROR);
|
fb_utils::logAndDie(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2476,8 +2479,7 @@ void LockManager::initialize(sh_mem* shmem_data, bool initializeMemory)
|
|||||||
shb* secondary_header = (shb*) alloc(sizeof(shb), NULL);
|
shb* secondary_header = (shb*) alloc(sizeof(shb), NULL);
|
||||||
if (!secondary_header)
|
if (!secondary_header)
|
||||||
{
|
{
|
||||||
gds__log("Fatal lock manager error: lock manager out of room");
|
fb_utils::logAndDie("Fatal lock manager error: lock manager out of room");
|
||||||
exit(STARTUP_ERROR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_header->lhb_secondary = SRQ_REL_PTR(secondary_header);
|
m_header->lhb_secondary = SRQ_REL_PTR(secondary_header);
|
||||||
@ -2497,8 +2499,7 @@ void LockManager::initialize(sh_mem* shmem_data, bool initializeMemory)
|
|||||||
{
|
{
|
||||||
if (!(history = (his*) alloc(sizeof(his), NULL)))
|
if (!(history = (his*) alloc(sizeof(his), NULL)))
|
||||||
{
|
{
|
||||||
gds__log("Fatal lock manager error: lock manager out of room");
|
fb_utils::logAndDie("Fatal lock manager error: lock manager out of room");
|
||||||
exit(STARTUP_ERROR);
|
|
||||||
}
|
}
|
||||||
*prior = SRQ_REL_PTR(history);
|
*prior = SRQ_REL_PTR(history);
|
||||||
history->his_type = type_his;
|
history->his_type = type_his;
|
||||||
|
@ -313,7 +313,7 @@ ISC_STATUS GDS_ATTACH_DATABASE(ISC_STATUS* user_status,
|
|||||||
return user_status[1];
|
return user_status[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_ATTACH_DATABASE");
|
||||||
rdb = port->port_context;
|
rdb = port->port_context;
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ ISC_STATUS GDS_BLOB_INFO(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = blob->rbl_rdb;
|
Rdb* rdb = blob->rbl_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_BLOB_INFO");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ ISC_STATUS GDS_CANCEL_BLOB(ISC_STATUS* user_status, Rbl** blob_handle)
|
|||||||
Rdb* rdb = blob->rbl_rdb;
|
Rdb* rdb = blob->rbl_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_CANCEL_BLOB");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
try
|
try
|
||||||
@ -448,7 +448,7 @@ ISC_STATUS GDS_CANCEL_EVENTS(ISC_STATUS* user_status, Rdb** handle, SLONG* id)
|
|||||||
Rdb* rdb = *handle;
|
Rdb* rdb = *handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_CANCEL_EVENTS");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -495,7 +495,7 @@ ISC_STATUS GDS_CLOSE_BLOB(ISC_STATUS* user_status, Rbl** blob_handle)
|
|||||||
Rdb* rdb = blob->rbl_rdb;
|
Rdb* rdb = blob->rbl_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_CLOSE_BLOB");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -543,7 +543,7 @@ ISC_STATUS GDS_COMMIT(ISC_STATUS* user_status, Rtr** rtr_handle)
|
|||||||
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_COMMIT");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ ISC_STATUS GDS_COMMIT_RETAINING(ISC_STATUS* user_status, Rtr** rtr_handle)
|
|||||||
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_COMMIT_RETAINING");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -631,7 +631,7 @@ ISC_STATUS GDS_COMPILE(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_COMPILE");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -741,7 +741,7 @@ ISC_STATUS GDS_CREATE_BLOB2(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_CREATE_BLOB2");
|
||||||
|
|
||||||
CHECK_HANDLE((*rtr_handle), type_rtr, isc_bad_trans_handle);
|
CHECK_HANDLE((*rtr_handle), type_rtr, isc_bad_trans_handle);
|
||||||
Rtr* transaction = *rtr_handle;
|
Rtr* transaction = *rtr_handle;
|
||||||
@ -844,7 +844,7 @@ ISC_STATUS GDS_CREATE_DATABASE(ISC_STATUS* user_status,
|
|||||||
return user_status[1];
|
return user_status[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_CREATE_DATABASE");
|
||||||
rdb = port->port_context;
|
rdb = port->port_context;
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -894,7 +894,7 @@ ISC_STATUS GDS_DATABASE_INFO(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *handle;
|
Rdb* rdb = *handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DATABASE_INFO");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -947,7 +947,7 @@ ISC_STATUS GDS_DDL(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DDL");
|
||||||
|
|
||||||
CHECK_HANDLE((*rtr_handle), type_rtr, isc_bad_trans_handle);
|
CHECK_HANDLE((*rtr_handle), type_rtr, isc_bad_trans_handle);
|
||||||
Rtr* transaction = *rtr_handle;
|
Rtr* transaction = *rtr_handle;
|
||||||
@ -996,7 +996,7 @@ ISC_STATUS GDS_DETACH(ISC_STATUS* user_status, Rdb** handle)
|
|||||||
Rdb* rdb = *handle;
|
Rdb* rdb = *handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DETACH");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -1078,7 +1078,7 @@ ISC_STATUS GDS_DROP_DATABASE(ISC_STATUS* user_status, Rdb** handle)
|
|||||||
Rdb* rdb = *handle;
|
Rdb* rdb = *handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DROP_DATABASE");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -1143,7 +1143,7 @@ ISC_STATUS GDS_DSQL_ALLOCATE(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_ALLOCATE");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -1252,7 +1252,7 @@ ISC_STATUS GDS_DSQL_EXECUTE2(ISC_STATUS* user_status,
|
|||||||
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
||||||
Rdb* rdb = statement->rsr_rdb;
|
Rdb* rdb = statement->rsr_rdb;
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_EXECUTE2");
|
||||||
|
|
||||||
Rtr* transaction = *rtr_handle;
|
Rtr* transaction = *rtr_handle;
|
||||||
if (transaction) {
|
if (transaction) {
|
||||||
@ -1487,7 +1487,7 @@ ISC_STATUS GDS_DSQL_EXECUTE_IMMED2(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_EXECUTE_IMMED2");
|
||||||
|
|
||||||
Rtr* transaction = *rtr_handle;
|
Rtr* transaction = *rtr_handle;
|
||||||
if (transaction) {
|
if (transaction) {
|
||||||
@ -1678,7 +1678,7 @@ ISC_STATUS GDS_DSQL_FETCH(ISC_STATUS* user_status,
|
|||||||
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
||||||
Rdb* rdb = statement->rsr_rdb;
|
Rdb* rdb = statement->rsr_rdb;
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_FETCH");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -1944,7 +1944,7 @@ ISC_STATUS GDS_DSQL_FREE(ISC_STATUS* user_status, Rsr** stmt_handle, USHORT opti
|
|||||||
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
||||||
Rdb* rdb = statement->rsr_rdb;
|
Rdb* rdb = statement->rsr_rdb;
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_FREE");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -2054,7 +2054,7 @@ ISC_STATUS GDS_DSQL_INSERT(ISC_STATUS* user_status,
|
|||||||
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
||||||
Rdb* rdb = statement->rsr_rdb;
|
Rdb* rdb = statement->rsr_rdb;
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_INSERT");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -2181,7 +2181,7 @@ ISC_STATUS GDS_DSQL_PREPARE(ISC_STATUS* user_status, Rtr** rtr_handle,
|
|||||||
Rdb* rdb = statement->rsr_rdb;
|
Rdb* rdb = statement->rsr_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_PREPARE");
|
||||||
|
|
||||||
Rtr* transaction = *rtr_handle;
|
Rtr* transaction = *rtr_handle;
|
||||||
if (transaction) {
|
if (transaction) {
|
||||||
@ -2333,7 +2333,7 @@ ISC_STATUS GDS_DSQL_SET_CURSOR(ISC_STATUS* user_status,
|
|||||||
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
||||||
Rdb* rdb = statement->rsr_rdb;
|
Rdb* rdb = statement->rsr_rdb;
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_SET_CURSOR");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -2431,7 +2431,7 @@ ISC_STATUS GDS_DSQL_SQL_INFO(ISC_STATUS* user_status,
|
|||||||
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
CHECK_HANDLE(statement, type_rsr, isc_bad_req_handle);
|
||||||
Rdb* rdb = statement->rsr_rdb;
|
Rdb* rdb = statement->rsr_rdb;
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_DSQL_SQL_INFO");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -2485,7 +2485,7 @@ ISC_STATUS GDS_GET_SEGMENT(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = blob->rbl_rdb;
|
Rdb* rdb = blob->rbl_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_GET_SEGMENT");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -2708,7 +2708,7 @@ ISC_STATUS GDS_GET_SLICE(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_GET_SLICE");
|
||||||
|
|
||||||
CHECK_HANDLE((*tra_handle), type_rtr, isc_bad_trans_handle);
|
CHECK_HANDLE((*tra_handle), type_rtr, isc_bad_trans_handle);
|
||||||
Rtr* transaction = *tra_handle;
|
Rtr* transaction = *tra_handle;
|
||||||
@ -2815,7 +2815,7 @@ ISC_STATUS GDS_OPEN_BLOB2(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_OPEN_BLOB2");
|
||||||
|
|
||||||
CHECK_HANDLE((*rtr_handle), type_rtr, isc_bad_trans_handle);
|
CHECK_HANDLE((*rtr_handle), type_rtr, isc_bad_trans_handle);
|
||||||
Rtr* transaction = *rtr_handle;
|
Rtr* transaction = *rtr_handle;
|
||||||
@ -2890,7 +2890,7 @@ ISC_STATUS GDS_PREPARE(ISC_STATUS* user_status,
|
|||||||
|
|
||||||
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_PREPARE");
|
||||||
|
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
@ -2956,7 +2956,7 @@ ISC_STATUS GDS_PUT_SEGMENT(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = blob->rbl_rdb;
|
Rdb* rdb = blob->rbl_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_PUT_SEGMENT");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3039,7 +3039,7 @@ ISC_STATUS GDS_PUT_SLICE(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_PUT_SLICE");
|
||||||
|
|
||||||
CHECK_HANDLE((*tra_handle), type_rtr, isc_bad_trans_handle);
|
CHECK_HANDLE((*tra_handle), type_rtr, isc_bad_trans_handle);
|
||||||
Rtr* transaction = *tra_handle;
|
Rtr* transaction = *tra_handle;
|
||||||
@ -3143,7 +3143,7 @@ ISC_STATUS GDS_QUE_EVENTS(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *handle;
|
Rdb* rdb = *handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_QUE_EVENTS");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
PACKET* packet = &rdb->rdb_packet;
|
PACKET* packet = &rdb->rdb_packet;
|
||||||
@ -3256,7 +3256,7 @@ ISC_STATUS GDS_RECEIVE(ISC_STATUS * user_status,
|
|||||||
Rdb* rdb = request->rrq_rdb;
|
Rdb* rdb = request->rrq_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_RECEIVE");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3483,7 +3483,7 @@ ISC_STATUS GDS_RECONNECT(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_RECONNECT");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3529,7 +3529,7 @@ ISC_STATUS GDS_RELEASE_REQUEST(ISC_STATUS * user_status, Rrq** req_handle)
|
|||||||
Rdb* rdb = request->rrq_rdb;
|
Rdb* rdb = request->rrq_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_RELEASE_REQUEST");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3577,7 +3577,7 @@ ISC_STATUS GDS_REQUEST_INFO(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = request->rrq_rdb;
|
Rdb* rdb = request->rrq_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_REQUEST_INFO");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3671,7 +3671,7 @@ ISC_STATUS GDS_ROLLBACK_RETAINING(ISC_STATUS* user_status, Rtr** rtr_handle)
|
|||||||
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_ROLLBACK_RETAINING");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3714,7 +3714,7 @@ ISC_STATUS GDS_ROLLBACK(ISC_STATUS* user_status, Rtr** rtr_handle)
|
|||||||
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
Rdb* rdb = (*rtr_handle)->rtr_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_ROLLBACK");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3759,7 +3759,7 @@ ISC_STATUS GDS_SEEK_BLOB(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = blob->rbl_rdb;
|
Rdb* rdb = blob->rbl_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_SEEK_BLOB");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3823,7 +3823,7 @@ ISC_STATUS GDS_SEND(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = request->rrq_rdb;
|
Rdb* rdb = request->rrq_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_SEND");
|
||||||
|
|
||||||
if (msg_type > request->rrq_max_msg)
|
if (msg_type > request->rrq_max_msg)
|
||||||
return handle_error(user_status, isc_badmsgnum);
|
return handle_error(user_status, isc_badmsgnum);
|
||||||
@ -3906,7 +3906,7 @@ ISC_STATUS GDS_SERVICE_ATTACH(ISC_STATUS* user_status,
|
|||||||
return user_status[1];
|
return user_status[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_SERVICE_ATTACH");
|
||||||
rdb = port->port_context;
|
rdb = port->port_context;
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -3957,7 +3957,7 @@ ISC_STATUS GDS_SERVICE_DETACH(ISC_STATUS* user_status, Rdb** handle)
|
|||||||
Rdb* rdb = *handle;
|
Rdb* rdb = *handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_svc_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_svc_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_SERVICE_DETACH");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -4023,7 +4023,7 @@ ISC_STATUS GDS_SERVICE_QUERY(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *svc_handle;
|
Rdb* rdb = *svc_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_svc_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_svc_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_SERVICE_QUERY");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -4076,7 +4076,7 @@ ISC_STATUS GDS_SERVICE_START(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *svc_handle;
|
Rdb* rdb = *svc_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_svc_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_svc_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_SERVICE_START");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -4125,7 +4125,7 @@ ISC_STATUS GDS_START_AND_SEND(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = request->rrq_rdb;
|
Rdb* rdb = request->rrq_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_START_AND_SEND");
|
||||||
|
|
||||||
if (msg_type > request->rrq_max_msg)
|
if (msg_type > request->rrq_max_msg)
|
||||||
return handle_error(user_status, isc_badmsgnum);
|
return handle_error(user_status, isc_badmsgnum);
|
||||||
@ -4212,7 +4212,7 @@ ISC_STATUS GDS_START(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = request->rrq_rdb;
|
Rdb* rdb = request->rrq_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_START");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -4284,7 +4284,7 @@ ISC_STATUS GDS_START_TRANSACTION(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_START_TRANSACTION");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -4340,7 +4340,7 @@ ISC_STATUS GDS_TRANSACT_REQUEST(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = *db_handle;
|
Rdb* rdb = *db_handle;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_TRANSACT_REQUEST");
|
||||||
|
|
||||||
Rtr* transaction = *rtr_handle;
|
Rtr* transaction = *rtr_handle;
|
||||||
CHECK_HANDLE(transaction, type_rtr, isc_bad_trans_handle);
|
CHECK_HANDLE(transaction, type_rtr, isc_bad_trans_handle);
|
||||||
@ -4472,7 +4472,7 @@ ISC_STATUS GDS_TRANSACTION_INFO(ISC_STATUS* user_status,
|
|||||||
Rdb* rdb = transaction->rtr_rdb;
|
Rdb* rdb = transaction->rtr_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_TRANSACTION_INFO");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -4509,7 +4509,7 @@ ISC_STATUS GDS_UNWIND(ISC_STATUS* user_status, Rrq** req_handle, USHORT level)
|
|||||||
Rdb* rdb = request->rrq_rdb;
|
Rdb* rdb = request->rrq_rdb;
|
||||||
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
CHECK_HANDLE(rdb, type_rdb, isc_bad_db_handle);
|
||||||
rem_port* port = rdb->rdb_port;
|
rem_port* port = rdb->rdb_port;
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "GDS_UNWIND");
|
||||||
|
|
||||||
rdb->set_status_vector(user_status);
|
rdb->set_status_vector(user_status);
|
||||||
|
|
||||||
@ -5430,7 +5430,7 @@ static THREAD_ENTRY_DECLARE event_thread(THREAD_ENTRY_PARAM arg)
|
|||||||
rem_port* stuff = NULL;
|
rem_port* stuff = NULL;
|
||||||
P_OP operation = op_void;
|
P_OP operation = op_void;
|
||||||
{ // scope
|
{ // scope
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "event_thread");
|
||||||
stuff = port->receive(&packet);
|
stuff = port->receive(&packet);
|
||||||
|
|
||||||
operation = packet.p_operation;
|
operation = packet.p_operation;
|
||||||
@ -5454,7 +5454,7 @@ static THREAD_ENTRY_DECLARE event_thread(THREAD_ENTRY_PARAM arg)
|
|||||||
|
|
||||||
Rvnt* event = NULL;
|
Rvnt* event = NULL;
|
||||||
{ // scope
|
{ // scope
|
||||||
RefMutexGuard portGuard(*port->port_sync);
|
RefMutexGuard portGuard(*port->port_sync, "event_thread - 2");
|
||||||
event = find_event(port, pevent->p_event_rid);
|
event = find_event(port, pevent->p_event_rid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6915,7 +6915,7 @@ static bool send_packet(rem_port* port, PACKET* packet, ISC_STATUS* user_status)
|
|||||||
user_status[1] = isc_net_write_err;
|
user_status[1] = isc_net_write_err;
|
||||||
user_status[2] = isc_arg_end;
|
user_status[2] = isc_arg_end;
|
||||||
|
|
||||||
RefMutexGuard guard(*port->port_write_sync);
|
RefMutexGuard guard(*port->port_write_sync, "send_packet");
|
||||||
|
|
||||||
// Send packets that were deferred
|
// Send packets that were deferred
|
||||||
|
|
||||||
@ -6960,7 +6960,7 @@ static bool send_partial_packet(rem_port* port, PACKET* packet, ISC_STATUS* user
|
|||||||
user_status[1] = isc_net_write_err;
|
user_status[1] = isc_net_write_err;
|
||||||
user_status[2] = isc_arg_end;
|
user_status[2] = isc_arg_end;
|
||||||
|
|
||||||
RefMutexGuard guard(*port->port_write_sync);
|
RefMutexGuard guard(*port->port_write_sync, "send_partial_packet");
|
||||||
|
|
||||||
// Send packets that were deferred
|
// Send packets that were deferred
|
||||||
|
|
||||||
|
@ -712,7 +712,7 @@ bool_t REMOTE_getbytes (XDR* xdrs, SCHAR* buff, u_int count)
|
|||||||
xdrs->x_handy = 0;
|
xdrs->x_handy = 0;
|
||||||
}
|
}
|
||||||
rem_port* port = (rem_port*) xdrs->x_public;
|
rem_port* port = (rem_port*) xdrs->x_public;
|
||||||
Firebird::RefMutexGuard queGuard(*port->port_que_sync);
|
Firebird::RefMutexGuard queGuard(*port->port_que_sync, "REMOTE_getbytes");
|
||||||
if (port->port_qoffset >= port->port_queue.getCount())
|
if (port->port_qoffset >= port->port_queue.getCount())
|
||||||
{
|
{
|
||||||
port->port_flags |= PORT_partial_data;
|
port->port_flags |= PORT_partial_data;
|
||||||
|
@ -812,13 +812,13 @@ public:
|
|||||||
#ifdef REM_SERVER
|
#ifdef REM_SERVER
|
||||||
bool haveRecvData()
|
bool haveRecvData()
|
||||||
{
|
{
|
||||||
Firebird::RefMutexGuard queGuard(*port_que_sync);
|
Firebird::RefMutexGuard queGuard(*port_que_sync, "rem_port::haveRecvData()");
|
||||||
return ((port_receive.x_handy > 0) || (port_qoffset < port_queue.getCount()));
|
return ((port_receive.x_handy > 0) || (port_qoffset < port_queue.getCount()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearRecvQue()
|
void clearRecvQue()
|
||||||
{
|
{
|
||||||
Firebird::RefMutexGuard queGuard(*port_que_sync);
|
Firebird::RefMutexGuard queGuard(*port_que_sync, "rem_port::clearRecvQue()");
|
||||||
port_queue.clear();
|
port_queue.clear();
|
||||||
port_qoffset = 0;
|
port_qoffset = 0;
|
||||||
port_receive.x_private = port_receive.x_base;
|
port_receive.x_private = port_receive.x_base;
|
||||||
|
@ -634,7 +634,7 @@ void SRVR_multi_thread( rem_port* main_port, USHORT flags)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dataSize -= asyncSize;
|
dataSize -= asyncSize;
|
||||||
Firebird::RefMutexGuard queGuard(*port->port_que_sync);
|
Firebird::RefMutexGuard queGuard(*port->port_que_sync, "SRVR_multi_thread 1");
|
||||||
memcpy(port->port_queue.add().getBuffer(dataSize), buffer + asyncSize, dataSize);
|
memcpy(port->port_queue.add().getBuffer(dataSize), buffer + asyncSize, dataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,7 +653,7 @@ void SRVR_multi_thread( rem_port* main_port, USHORT flags)
|
|||||||
fb_assert(portLocked);
|
fb_assert(portLocked);
|
||||||
fb_assert(port->port_requests_queued.value() == 0);
|
fb_assert(port->port_requests_queued.value() == 0);
|
||||||
|
|
||||||
Firebird::RefMutexGuard queGuard(*port->port_que_sync);
|
Firebird::RefMutexGuard queGuard(*port->port_que_sync, "SRVR_multi_thread 2");
|
||||||
|
|
||||||
const rem_port::RecvQueState recvState = port->getRecvState();
|
const rem_port::RecvQueState recvState = port->getRecvState();
|
||||||
port->receive(&request->req_receive);
|
port->receive(&request->req_receive);
|
||||||
@ -3285,7 +3285,7 @@ static bool process_packet(rem_port* port, PACKET* sendL, PACKET* receive, rem_p
|
|||||||
* sent.
|
* sent.
|
||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
Firebird::RefMutexGuard portGuard(*port->port_sync);
|
Firebird::RefMutexGuard portGuard(*port->port_sync, "process_packet");
|
||||||
DecrementRequestsQueued dec(port);
|
DecrementRequestsQueued dec(port);
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -4666,7 +4666,7 @@ static void server_ast(void* event_void, USHORT length, const UCHAR* items)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Firebird::RefMutexGuard portGuard(*port->port_sync);
|
Firebird::RefMutexGuard portGuard(*port->port_sync, "server_ast");
|
||||||
|
|
||||||
PACKET packet;
|
PACKET packet;
|
||||||
packet.p_operation = op_event;
|
packet.p_operation = op_event;
|
||||||
@ -5206,7 +5206,7 @@ static THREAD_ENTRY_DECLARE loopThread(THREAD_ENTRY_PARAM)
|
|||||||
|
|
||||||
Firebird::RefMutexEnsureUnlock portQueGuard(*request->req_port->port_que_sync);
|
Firebird::RefMutexEnsureUnlock portQueGuard(*request->req_port->port_que_sync);
|
||||||
{ // port_sync scope
|
{ // port_sync scope
|
||||||
Firebird::RefMutexGuard portGuard(*request->req_port->port_sync);
|
Firebird::RefMutexGuard portGuard(*request->req_port->port_sync, "loopThread");
|
||||||
|
|
||||||
if (request->req_port->port_state == rem_port::DISCONNECTED ||
|
if (request->req_port->port_state == rem_port::DISCONNECTED ||
|
||||||
!process_packet(request->req_port, &request->req_send, &request->req_receive, &port))
|
!process_packet(request->req_port, &request->req_send, &request->req_receive, &port))
|
||||||
|
Loading…
Reference in New Issue
Block a user