MCPcopy Create free account
hub / github.com/Starry-OS/StarryOS / exit_robust_list

Function exit_robust_list

api/src/task.rs:127–153  ·  view source on GitHub ↗
(head: *const RobustListHead)

Source from the content-addressed store, hash-verified

125}
126
127pub fn exit_robust_list(head: *const RobustListHead) -> AxResult<()> {
128 // Reference: https://elixir.bootlin.com/linux/v6.13.6/source/kernel/futex/core.c#L777
129
130 let mut limit = ROBUST_LIST_LIMIT;
131
132 let end_ptr = unsafe { &raw const (*head).list };
133 let head = head.vm_read()?;
134 let mut entry = head.list.next;
135 let offset = head.futex_offset;
136 let pending = head.list_op_pending;
137
138 while !core::ptr::eq(entry, end_ptr) {
139 let next_entry = entry.vm_read()?.next;
140 if entry != pending {
141 handle_futex_death(entry, offset)?;
142 }
143 entry = next_entry;
144
145 limit -= 1;
146 if limit == 0 {
147 return Err(AxError::FilesystemLoop);
148 }
149 axtask::yield_now();
150 }
151
152 Ok(())
153}
154
155pub fn do_exit(exit_code: i32, group_exit: bool) {
156 let curr = current();

Callers 1

do_exitFunction · 0.85

Calls 1

handle_futex_deathFunction · 0.85

Tested by

no test coverage detected