mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Lock att_mutex in Attachment's constructor
This commit is contained in:
parent
489245fa50
commit
422338e5e3
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user