@@ -230,6 +230,7 @@ const ULONG DBB_gc_background = 0x20000L; // background garbage collection by
230
230
const ULONG DBB_sweep_starting = 0x40000L ; // Auto-sweep is starting
231
231
const ULONG DBB_creating = 0x80000L ; // Database creation is in progress
232
232
const ULONG DBB_shared = 0x100000L ; // Database object is shared among connections
233
+ const ULONG DBB_restoring = 0x200000L ; // Database restore is in progress
233
234
234
235
//
235
236
// dbb_ast_flags
@@ -311,9 +312,6 @@ class Database : public pool_alloc<type_dbb>
311
312
bool incTempCacheUsage (FB_SIZE_T size);
312
313
void decTempCacheUsage (FB_SIZE_T size);
313
314
314
- bool getRestoring () const { return m_restoring; }
315
- void setRestoring (bool value) { m_restoring = value; }
316
-
317
315
private:
318
316
const Firebird::string m_id;
319
317
const Firebird::RefPtr<const Firebird::Config> m_config;
@@ -324,16 +322,14 @@ class Database : public pool_alloc<type_dbb>
324
322
Firebird::Mutex m_mutex;
325
323
std::atomic<FB_UINT64> m_tempCacheUsage; // total size of in-memory temp space chunks (see TempSpace class)
326
324
const FB_UINT64 m_tempCacheLimit;
327
- bool m_restoring;
328
325
329
326
explicit GlobalObjectHolder (const Firebird::string& id,
330
327
const Firebird::PathName& filename,
331
328
Firebird::RefPtr<const Firebird::Config> config)
332
329
: m_id(getPool(), id), m_config(config),
333
330
m_replConfig(Replication::Config::get(filename)),
334
331
m_tempCacheUsage(0 ),
335
- m_tempCacheLimit(m_config->getTempCacheLimit ()),
336
- m_restoring(false )
332
+ m_tempCacheLimit(m_config->getTempCacheLimit ())
337
333
{}
338
334
};
339
335
@@ -725,12 +721,15 @@ class Database : public pool_alloc<type_dbb>
725
721
726
722
bool isRestoring () const
727
723
{
728
- return dbb_gblobj_holder-> getRestoring () ;
724
+ return dbb_flags & DBB_restoring ;
729
725
}
730
726
731
727
void setRestoring (bool value)
732
728
{
733
- dbb_gblobj_holder->setRestoring (value);
729
+ if (value)
730
+ dbb_flags |= DBB_restoring;
731
+ else
732
+ dbb_flags &= ~DBB_restoring;
734
733
}
735
734
736
735
private:
0 commit comments