> > + /* For linearizability */ > > + guard(mutex)(&data->key_lock); > > What is the exact purpose of this mutex? What does it protect? It protects key sequence, so there wouldn't be race between two press & release combinations resuulting into press - press - release - release order. -- Gladyshev Ilya