MCPcopy Index your code
hub / github.com/RustPython/RustPython / create

Method create

crates/stdlib/src/multiprocessing.rs:68–75  ·  view source on GitHub ↗
(value: i32, maxvalue: i32, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

66
67 impl SemHandle {
68 fn create(value: i32, maxvalue: i32, vm: &VirtualMachine) -> PyResult<Self> {
69 let handle =
70 unsafe { CreateSemaphoreW(core::ptr::null(), value, maxvalue, core::ptr::null()) };
71 if handle == 0 as HANDLE {
72 return Err(vm.new_last_os_error());
73 }
74 Ok(SemHandle { raw: handle })
75 }
76
77 #[inline]
78 fn as_raw(&self) -> HANDLE {

Callers

nothing calls this directly

Calls 8

semaphore_nameFunction · 0.85
os_errorFunction · 0.85
sem_unlinkFunction · 0.85
new_last_os_errorMethod · 0.80
ErrClass · 0.50
SomeClass · 0.50
as_ptrMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected