http://en.m.wikipedia.org/wiki/Lamport%27s_bakery_algorithm