Function parking_lot::unpark_one [] [src]

pub unsafe fn unpark_one(key: usize, callback: &mut FnMut(UnparkResult)) -> UnparkResult

Unparks one thread from the queue associated with the given key.

The callback function is called while the queue is locked and before the target thread is woken up. The UnparkResult argument to the function indicates whether a thread was found in the queue and whether this was the last thread in the queue. This value is also returned by unpark_one.

Safety

You should only call this function with an address that you control, since you could otherwise interfere with the operation of other synchronization primitives.

The callback function is called while the queue is locked and must not panic or call into any function in parking_lot.