[][src]Crate parking

Thread parking and unparking.

This is a copy of the park()/unpark() mechanism from the standard library.

What is parking

Conceptually, each Parker has a token which is initially not present:

Analogy with channels

Another way of thinking about Parker is as a bounded channel with capacity of 1.

Then, Parker::park() is equivalent to blocking on a receive operation, and Unparker::unpark() is equivalent to a non-blocking send operation.

Structs

Parker

Parks a thread.

Unparker

Unparks a thread.