mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Add RLock._is_owned
This commit is contained in:
3 files changed
+7
-3
No files matched your search
Generated
+1
-2
@@ -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
@@ -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" }
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user