Correct locking and unlocking, use the full message as the key.
Correctly handle a spurious wake up
Don't sort, already sorted coming from the dao