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

Method blockingAstHandler

src/jrd/nbak.cpp:102–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void NBackupStateLock::blockingAstHandler(thread_db* tdbb)
103{
104 // master instance should not try to acquire localStateLock or enter "flush" mode
105 if (backup_manager->isMaster())
106 {
107 GlobalRWLock::blockingAstHandler(tdbb);
108 return;
109 }
110
111 // Ensure we have no dirty pages in local cache before releasing
112 // of state lock
113 if (!backup_manager->databaseFlushInProgress())
114 {
115 backup_manager->beginFlush();
116 NBAK_TRACE_AST( ("backup_manager->beginFlush()") );
117
118 Firebird::MutexUnlockGuard counterGuard(counterMutex, FB_FUNCTION);
119 CCH_flush_ast(tdbb);
120 NBAK_TRACE_AST(("database FLUSHED"));
121 }
122
123 { // scope
124 backup_manager->stateBlocking = true;
125 Firebird::MutexUnlockGuard counterGuard(counterMutex, FB_FUNCTION);
126 backup_manager->stateBlocking = !backup_manager->localStateLock.tryBeginWrite(FB_FUNCTION);
127 if (backup_manager->stateBlocking)
128 return;
129 }
130
131 GlobalRWLock::blockingAstHandler(tdbb);
132
133 if (cachedLock->lck_physical == LCK_read)
134 backup_manager->endFlush();
135
136 backup_manager->localStateLock.endWrite();
137}
138
139
140/******************************** NBackupAllocLock ******************************/

Callers

nothing calls this directly

Calls 7

CCH_flush_astFunction · 0.85
isMasterMethod · 0.80
beginFlushMethod · 0.80
tryBeginWriteMethod · 0.80
endFlushMethod · 0.80
endWriteMethod · 0.80

Tested by

no test coverage detected