@@ -230,6 +230,7 @@ const ULONG DBB_gc_background = 0x20000L; // background garbage collection by
230230const ULONG DBB_sweep_starting = 0x40000L ; // Auto-sweep is starting
231231const ULONG DBB_creating = 0x80000L ; // Database creation is in progress
232232const ULONG DBB_shared = 0x100000L ; // Database object is shared among connections
233+ const ULONG DBB_restoring = 0x200000L ; // Database restore is in progress
233234
234235//
235236// dbb_ast_flags
@@ -311,9 +312,6 @@ class Database : public pool_alloc<type_dbb>
311312 bool incTempCacheUsage (FB_SIZE_T size);
312313 void decTempCacheUsage (FB_SIZE_T size);
313314
314- bool getRestoring () const { return m_restoring; }
315- void setRestoring (bool value) { m_restoring = value; }
316-
317315 private:
318316 const Firebird::string m_id;
319317 const Firebird::RefPtr<const Firebird::Config> m_config;
@@ -324,16 +322,14 @@ class Database : public pool_alloc<type_dbb>
324322 Firebird::Mutex m_mutex;
325323 std::atomic<FB_UINT64> m_tempCacheUsage; // total size of in-memory temp space chunks (see TempSpace class)
326324 const FB_UINT64 m_tempCacheLimit;
327- bool m_restoring;
328325
329326 explicit GlobalObjectHolder (const Firebird::string& id,
330327 const Firebird::PathName& filename,
331328 Firebird::RefPtr<const Firebird::Config> config)
332329 : m_id(getPool(), id), m_config(config),
333330 m_replConfig(Replication::Config::get(filename)),
334331 m_tempCacheUsage(0 ),
335- m_tempCacheLimit(m_config->getTempCacheLimit ()),
336- m_restoring(false )
332+ m_tempCacheLimit(m_config->getTempCacheLimit ())
337333 {}
338334 };
339335
@@ -725,12 +721,15 @@ class Database : public pool_alloc<type_dbb>
725721
726722 bool isRestoring () const
727723 {
728- return dbb_gblobj_holder-> getRestoring () ;
724+ return dbb_flags & DBB_restoring ;
729725 }
730726
731727 void setRestoring (bool value)
732728 {
733- dbb_gblobj_holder->setRestoring (value);
729+ if (value)
730+ dbb_flags |= DBB_restoring;
731+ else
732+ dbb_flags &= ~DBB_restoring;
734733 }
735734
736735private:
0 commit comments