Added support to disallow multiple processes from opening the same database file in linux and darwin

This commit is contained in:
gandeevanr 2024-07-14 18:32:57 -07:00
parent a6369982fe
commit 9ef212edd3
9 changed files with 240 additions and 21 deletions

View file

@ -8,6 +8,8 @@ use std::{
};
pub trait File {
fn lock_file(&self, exclusive: bool) -> Result<()>;
fn unlock_file(&self) -> Result<()>;
fn pread(&self, pos: usize, c: Rc<Completion>) -> Result<()>;
fn pwrite(&self, pos: usize, buffer: Rc<RefCell<Buffer>>, c: Rc<WriteCompletion>)
-> Result<()>;
@ -134,3 +136,5 @@ cfg_block! {
pub use generic::GenericIO as PlatformIO;
}
}
mod common;