diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index ab2e77d953..b39d663da2 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -3982,7 +3982,6 @@ static THREAD_ENTRY_DECLARE cache_reader(THREAD_ENTRY_PARAM arg) tdbb->setDatabase(dbb); Attachment* const attachment = Attachment::create(dbb); tdbb->setAttachment(attachment); - attachment->att_mutex.enter(); attachment->att_filename = dbb->dbb_filename; Jrd::ContextPoolHolder context(tdbb, dbb->dbb_bufferpool); @@ -4146,7 +4145,6 @@ static THREAD_ENTRY_DECLARE cache_writer(THREAD_ENTRY_PARAM arg) tdbb->setDatabase(dbb); Attachment* const attachment = Attachment::create(dbb); tdbb->setAttachment(attachment); - attachment->att_mutex.enter(); attachment->att_filename = dbb->dbb_filename; Jrd::ContextPoolHolder context(tdbb, dbb->dbb_bufferpool); diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 1a34aeb7e3..2b962301a2 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -807,7 +807,6 @@ ISC_STATUS GDS_ATTACH_DATABASE(ISC_STATUS* user_status, attachment->att_remote_address = options.dpb_remote_address; attachment->att_remote_pid = options.dpb_remote_pid; attachment->att_remote_process = options.dpb_remote_process; - attachment->att_mutex.enter(); attachment->att_next = dbb->dbb_attachments; dbb->dbb_attachments = attachment; @@ -1968,6 +1967,7 @@ ISC_STATUS GDS_CREATE_DATABASE(ISC_STATUS* user_status, databases_mutex->leave(); *handle = attachment; + attachment->att_mutex.leave(); } // try catch (const DelayFailedLogin& ex) @@ -4947,6 +4947,7 @@ Attachment::Attachment(MemoryPool* pool, Database* dbb) att_remote_process(*pool), att_dsql_cache(*pool) { + att_mutex.enter(); } diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index 3f82801014..4155c2efc9 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -3897,7 +3897,6 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg) Attachment* const attachment = Attachment::create(dbb); tdbb->setAttachment(attachment); - attachment->att_mutex.enter(); attachment->att_filename = dbb->dbb_filename; attachment->att_flags = ATT_garbage_collector;