“if it isn’t” already in the previous edition.
Page 195, first paragraph after the example, lines 1-2 :
Sometimes you want to claim a lock if a mutex is currently unlocked, but you don’t want to
suspend the current thread if it isn’t.
I had to read several times to understand “if it isn’t” : suspended / locked / unlocked ?
As I had never worked with threads, I have experimented with my own code and with the code which follows this paragraph. So “if it isn’t” means “if the mutex isn’t unlocked”. Instead of this double negation, I would prefer to read :
but you don’t want to suspend the current thread if the mutex is locked.