The kernel could easily expose this information by writing into the
thread's TLS area.
So:
- the kernel maintains a current_cpu field in a thread's tls
- lock() atomically writes a pointer to the current thread's current_cpu
when acquiring
- the kernel writes an invalid value to current_cpu when switching out
- a contended lock() retrieves the current_cpu pointer, and spins as
long as it is a valid cpu
--
error compiling committee.c: too many arguments to function
--