diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9399954 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "cbor"] + path = cbor + url = git@github.com:dr-bonez/cbor.git +[submodule "json-patch"] + path = json-patch + url = git@github.com:dr-bonez/json-patch.git +[submodule "json-ptr"] + path = json-ptr + url = git@github.com:dr-bonez/json-ptr.git +[submodule "qutex"] + path = qutex + url = git@github.com:dr-bonez/qutex.git diff --git a/Cargo.toml b/Cargo.toml index ea93a0b..7c73749 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,8 @@ members = [ "patch-db", "patch-db-derive", "patch-db-derive-internals", + "cbor", + "json-patch", + "json-ptr", + "qutex", ] diff --git a/cbor b/cbor new file mode 160000 index 0000000..1debea3 --- /dev/null +++ b/cbor @@ -0,0 +1 @@ +Subproject commit 1debea3d05316b2e4a1ad6b82b8996cf2aaa890f diff --git a/json-patch b/json-patch new file mode 160000 index 0000000..a2c345b --- /dev/null +++ b/json-patch @@ -0,0 +1 @@ +Subproject commit a2c345bd1e4af73de0ce86cbf6724e0c0f867ace diff --git a/json-ptr b/json-ptr new file mode 160000 index 0000000..b2da19f --- /dev/null +++ b/json-ptr @@ -0,0 +1 @@ +Subproject commit b2da19fe6acd754228ebacc3ade51321240bc74a diff --git a/patch-db/Cargo.toml b/patch-db/Cargo.toml index dbcbd4f..eb69ba3 100644 --- a/patch-db/Cargo.toml +++ b/patch-db/Cargo.toml @@ -10,13 +10,13 @@ edition = "2018" async-trait = "0.1.42" fd-lock-rs = "0.1.3" futures = "0.3.8" -json-patch = { path = "../../json-patch" } -json-ptr = { path = "../../json-ptr" } +json-patch = { path = "../json-patch" } +json-ptr = { path = "../json-ptr" } nix = "0.20.0" -qutex-2 = { path = "../../qutex" } +qutex-2 = { path = "../qutex" } serde = { version = "1.0.118", features = ["rc"] } serde_json = "1.0.61" -serde_cbor = { git = "https://github.com/dr-bonez/cbor.git" } +serde_cbor = { path = "../cbor" } thiserror = "1.0.23" tokio = { version = "1.0.1", features = ["sync", "fs", "rt", "io-util", "macros"] } diff --git a/patch-db/src/lib.rs b/patch-db/src/lib.rs index e001553..6e3ad53 100644 --- a/patch-db/src/lib.rs +++ b/patch-db/src/lib.rs @@ -880,8 +880,8 @@ impl Locker { async fn add_write_lock + Clone, V: SegList + Clone>( &self, ptr: &JsonPointer, - locks: &mut Vec<(JsonPointer, LockerGuard)>, - extra_locks: &mut [&mut [(JsonPointer, LockerGuard)]], + locks: &mut Vec<(JsonPointer, LockerGuard)>, // tx locks + extra_locks: &mut [&mut [(JsonPointer, LockerGuard)]], // tx parent locks ) { let mut final_lock = None; for lock in extra_locks @@ -900,7 +900,7 @@ impl Locker { lock.1 = match guard { LockerGuard::Read(LockerReadGuard(guard)) if !remainder.is_empty() => { // read guard already exists at higher level - let mut lock = guard.try_lock().unwrap(); + let mut lock = guard.lock().await; if let Some(l) = lock.take() { let mut orig_lock = None; let mut lock = ReadGuard::upgrade(l).await.unwrap(); diff --git a/qutex b/qutex new file mode 160000 index 0000000..5e9c912 --- /dev/null +++ b/qutex @@ -0,0 +1 @@ +Subproject commit 5e9c9124d4a2378d9ab85d072d61bcc255f75cf5