Shared: ticket = 0, release_count = 0;
Lock: fetch & inc reg1, ticket_addr
Wait: lw reg2, release_count_addr /* while ( release_count != ticket); */
sub reg3, reg2, reg1
bnez reg3, Wait
Unlock: addi reg2, reg2, 0x1 /* release_count ++ */
sw reg2, release_count_addr