MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / detachIdle

Method detachIdle

src/jrd/WorkerAttachment.cpp:438–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438bool WorkerAttachment::detachIdle(StableAttachmentPart* sAtt)
439{
440 WorkerAttachment* item = NULL;
441 { // scope
442 AttSyncLockGuard attGuard(sAtt->getSync(), FB_FUNCTION);
443
444 Attachment* att = sAtt->getHandle();
445 if (!att || att->att_use_count > 0)
446 return false;
447
448 item = getByName(att->att_database->dbb_filename);
449 }
450
451 if (item)
452 {
453 MutexLockGuard guard(item->m_mutex, FB_FUNCTION);
454
455 FB_SIZE_T pos;
456 if (item->m_idleAtts.find(sAtt, pos))
457 item->m_idleAtts.remove(pos);
458 else
459 return false;
460 }
461
462 FbLocalStatus status;
463 doDetach(&status, sAtt);
464
465 return true;
466}
467
468StableAttachmentPart* WorkerAttachment::doAttach(FbStatusVector* status, Database* dbb)
469{

Callers

nothing calls this directly

Calls 4

getSyncMethod · 0.45
getHandleMethod · 0.45
findMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected