MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / add_handle

Method add_handle

kernel/src/process.rs:93–106  ·  view source on GitHub ↗

Add a Rendezvous to this process, returning the handle

(&mut self, rv: Arc<RwLock<Rendezvous>>)

Source from the content-addressed store, hash-verified

91 /// Add a Rendezvous to this process, returning
92 /// the handle
93 fn add_handle(&mut self, rv: Arc<RwLock<Rendezvous>>) -> usize {
94 // Find if there is an empty handles slot
95 if let Some(index) = self.handles.iter().position(
96 |handle| handle.is_none()) {
97
98 // Use empty slot
99 self.handles[index] = Some(rv);
100 return index;
101 }
102
103 // No free slot -> Add one
104 self.handles.push(Some(rv));
105 self.handles.len() - 1
106 }
107}
108
109/// Per-thread state

Callers 1

open_pathFunction · 0.80

Calls 3

iterMethod · 0.80
pushMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected