Add RLock._is_owned

This commit is contained in:
Noah committed 2021-02-20 21:04:30 -06:00
1 parent bcdda5eef8
commit a0d9481fe5
3 files changed
+7 -3

No files matched your search

Generated
+1 -2
View File
@@ -1101,8 +1101,7 @@ checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
[[package]]
name = "lock_api"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312"
source = "git+https://github.com/coolreader18/parking_lot?branch=remutex-is_owned#391cf555e94c05450cea2e88b42c95c6631ab163"
dependencies = [
"scopeguard",
]
+1 -1
View File
@@ -69,4 +69,4 @@ opt-level = 3
[patch.crates-io]
# REDOX START, Uncommment when you want to compile/check with redoxer
# REDOX END
lock_api = { git = "https://github.com/coolreader18/parking_lot", branch = "remutex-is_owned" }
+5
View File
@@ -191,6 +191,11 @@ impl PyRLock {
Ok(())
}
#[pymethod]
fn _is_owned(&self) -> bool {
self.mu.is_owned_by_current_thread()
}
#[pymethod(magic)]
fn exit(&self, _args: FuncArgs, vm: &VirtualMachine) -> PyResult<()> {
self.release(vm)