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

Improve performance a bit.

This commit is contained in:
hvlad 2009-11-30 09:25:49 +00:00
parent d7e85fa217
commit 6db9d419b3
2 changed files with 8 additions and 2 deletions

View File

@ -253,8 +253,11 @@ public:
CheckoutLockGuard(Database* dbb, Firebird::Mutex& m)
: mutex(m)
{
Checkout dcoHolder(dbb);
mutex.enter();
if (!mutex.tryEnter())
{
Checkout dcoHolder(dbb);
mutex.enter();
}
}
~CheckoutLockGuard()

View File

@ -174,6 +174,9 @@ namespace
inline void validateHandle(thread_db* tdbb, Jrd::Attachment* const attachment)
{
if (attachment == tdbb->getAttachment())
return;
if (!attachment->checkHandle() || !attachment->att_database->checkHandle())
{
status_exception::raise(Arg::Gds(isc_bad_db_handle));