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

Function semaphore_name

crates/stdlib/src/multiprocessing.rs:1114–1122  ·  view source on GitHub ↗
(vm: &VirtualMachine, name: &str)

Source from the content-addressed store, hash-verified

1112 }
1113
1114 fn semaphore_name(vm: &VirtualMachine, name: &str) -> PyResult<CString> {
1115 // POSIX semaphore names must start with /
1116 let mut full = String::with_capacity(name.len() + 1);
1117 if !name.starts_with('/') {
1118 full.push('/');
1119 }
1120 full.push_str(name);
1121 CString::new(full).map_err(|_| vm.new_value_error("embedded null character"))
1122 }
1123
1124 fn handle_wait_error(vm: &VirtualMachine, saved_errno: Errno) -> PyResult<bool> {
1125 match saved_errno {

Callers 3

createMethod · 0.85
open_existingMethod · 0.85
sem_unlinkFunction · 0.85

Calls 5

newFunction · 0.85
starts_withMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45
push_strMethod · 0.45

Tested by

no test coverage detected