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

Method remapSnapshots

src/jrd/tpc.cpp:888–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888void TipCache::remapSnapshots(bool sync)
889{
890 // Can only be called on initialized TipCache
891 fb_assert(m_tpcHeader);
892
893 SnapshotList* snapshots = m_snapshots->getHeader();
894
895 if (snapshots->slots_allocated.load(std::memory_order_acquire) !=
896 (m_snapshots->sh_mem_length_mapped - offsetof(SnapshotList, slots[0])) / sizeof(SnapshotData))
897 {
898 SharedMutexGuard guard(m_snapshots, false);
899 if (sync)
900 guard.lock();
901
902 LocalStatus ls;
903 CheckStatusWrapper localStatus(&ls);
904 if (!m_snapshots->remapFile(&localStatus,
905 static_cast<ULONG>(
906 snapshots->slots_allocated.load(std::memory_order_relaxed) * sizeof(SnapshotData) +
907 offsetof(SnapshotList, slots[0])), false))
908 {
909 status_exception::raise(&localStatus);
910 }
911 }
912}
913
914
915SnapshotHandle TipCache::beginSnapshot(thread_db* tdbb, AttNumber attachmentId, CommitNumber& commitNumber)

Callers

nothing calls this directly

Calls 5

raiseFunction · 0.85
remapFileMethod · 0.80
getHeaderMethod · 0.45
loadMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected