(entry: *mut RobustList, offset: i64)
| 107 | } |
| 108 | |
| 109 | fn handle_futex_death(entry: *mut RobustList, offset: i64) -> AxResult<()> { |
| 110 | let address = (entry as u64) |
| 111 | .checked_add_signed(offset) |
| 112 | .ok_or(AxError::InvalidInput)?; |
| 113 | let address: usize = address.try_into().map_err(|_| AxError::InvalidInput)?; |
| 114 | let key = FutexKey::new_current(address); |
| 115 | |
| 116 | let curr = current(); |
| 117 | let futex_table = curr.as_thread().proc_data.futex_table_for(&key); |
| 118 | |
| 119 | let Some(futex) = futex_table.get(&key) else { |
| 120 | return Ok(()); |
| 121 | }; |
| 122 | futex.owner_dead.store(true, Ordering::SeqCst); |
| 123 | futex.wq.wake(1, u32::MAX); |
| 124 | Ok(()) |
| 125 | } |
| 126 | |
| 127 | pub fn exit_robust_list(head: *const RobustListHead) -> AxResult<()> { |
| 128 | // Reference: https://elixir.bootlin.com/linux/v6.13.6/source/kernel/futex/core.c#L777 |
no test coverage detected