Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Journal_Construction_Lock.cpp
Go to the documentation of this file.
2
3namespace joedb
4{
5 ////////////////////////////////////////////////////////////////////////////
7 ////////////////////////////////////////////////////////////////////////////
8 (
9 Buffered_File &file
10 ):
11 file(file)
12 {
13 if (file.is_readonly())
14 {
15 file.shared_lock_head();
16 creating_new = false;
17 }
18 else
19 {
20 if (file.is_shared())
23 creating_new = file.get_size() == 0;
24 }
25 }
26
27 ////////////////////////////////////////////////////////////////////////////
29 ////////////////////////////////////////////////////////////////////////////
30 {
31 file.unlock_head();
32 if (file.is_shared())
33 file.unlock_tail();
34 }
35}
virtual int64_t get_size() const
bool is_shared() const noexcept
void unlock_head() noexcept
bool is_readonly() const noexcept
void unlock_tail() noexcept
Definition Blob.h:7