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

Method StateWriteGuard

src/jrd/nbak.cpp:163–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161/******************************** BackupManager::StateWriteGuard ******************************/
162
163BackupManager::StateWriteGuard::StateWriteGuard(thread_db* tdbb, Jrd::WIN* window)
164 : m_tdbb(tdbb), m_window(NULL), m_success(false)
165{
166 Database* const dbb = tdbb->getDatabase();
167 Jrd::Attachment* const att = tdbb->getAttachment();
168
169 dbb->dbb_backup_manager->beginFlush();
170 CCH_flush(tdbb, FLUSH_ALL, 0); // Flush local cache to release all dirty pages
171
172 CCH_FETCH(tdbb, window, LCK_write, pag_header);
173
174 dbb->dbb_backup_manager->localStateLock.beginWrite(FB_FUNCTION);
175
176 if (!dbb->dbb_backup_manager->lockStateWrite(tdbb, LCK_WAIT))
177 {
178 dbb->dbb_backup_manager->localStateLock.endWrite();
179 ERR_bugcheck_msg("Can't lock state for write");
180 }
181
182 dbb->dbb_backup_manager->endFlush();
183
184 NBAK_TRACE(("backup state locked for write"));
185 m_window = window;
186}
187
188BackupManager::StateWriteGuard::~StateWriteGuard()
189{

Callers

nothing calls this directly

Calls 10

CCH_flushFunction · 0.85
CCH_FETCHFunction · 0.85
ERR_bugcheck_msgFunction · 0.85
getDatabaseMethod · 0.80
beginFlushMethod · 0.80
beginWriteMethod · 0.80
lockStateWriteMethod · 0.80
endWriteMethod · 0.80
endFlushMethod · 0.80
getAttachmentMethod · 0.45

Tested by

no test coverage detected