8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:03:03 +01:00

Backported (from trunk) more reliable AST handling during the database cleanup.

This commit is contained in:
dimitr 2012-11-22 12:45:45 +00:00
parent 9f60a27a7f
commit 5eaecbbfc0
5 changed files with 9 additions and 19 deletions

View File

@ -91,8 +91,6 @@ namespace Jrd
delete dbb_monitoring_data;
delete dbb_backup_manager;
dbb_flags |= DBB_destroying;
Checkout dcoHolder(this);
// This line decrements the usage counter and may cause the destructor to be called.
// It should happen with the dbb_sync unlocked.

View File

@ -106,8 +106,7 @@ const ULONG DBB_being_opened = 0x10000L; // database is being attached to
const ULONG DBB_gc_cooperative = 0x20000L; // cooperative garbage collection
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_destroying = 0x100000L; // database destructor is called
const ULONG DBB_monitor_locking = 0x200000L; // monitoring lock is being acquired
const ULONG DBB_monitor_locking = 0x100000L; // monitoring lock is being acquired
//
// dbb_ast_flags
@ -197,7 +196,7 @@ public:
Firebird::status_exception::raise(Firebird::Arg::Gds(isc_bad_db_handle));
}
if (ast && dbb->dbb_flags & DBB_destroying)
if (ast && dbb->dbb_flags & DBB_not_in_use)
{
sync.unlock();
sync.release();

View File

@ -373,16 +373,13 @@ int DatabaseSnapshot::blockingAst(void* ast_object)
if (!(dbb->dbb_ast_flags & DBB_monitor_off))
{
// Write the data to the shared memory
if (!(dbb->dbb_flags & DBB_not_in_use))
try
{
try
{
dumpData(tdbb);
}
catch (const Exception& ex)
{
iscLogException("Cannot dump the monitoring data", ex);
}
dumpData(tdbb);
}
catch (const Exception& ex)
{
iscLogException("Cannot dump the monitoring data", ex);
}
// Release the lock, if feasible

View File

@ -61,8 +61,7 @@ int GlobalRWLock::blocking_ast_cached_lock(void* ast_object)
ThreadContextHolder tdbb;
tdbb->setDatabase(dbb);
// do nothing if dbb is shutting down
if (!(dbb->dbb_flags & DBB_not_in_use))
if (globalRWLock->cachedLock)
globalRWLock->blockingAstHandler(tdbb);
}
catch (const Firebird::Exception&)

View File

@ -374,9 +374,6 @@ int CCH_down_grade_dbb(void* ast_object)
{
Database::SyncGuard dsGuard(dbb, true);
if (dbb->dbb_flags & DBB_not_in_use)
return 0;
Lock* const lock = dbb->dbb_lock;
// Since this routine will be called asynchronously,