No, this is not a double lock pattern, because when you lock a record, writing to shared variables is not performed.
The main problem that you may encounter is that threadSuspended changes from false to true may not be noticed as timely, due to caching or registration errors. Problems with register caching are the biggest problem (as a result, cache coherence ultimately solves, although it may take a few microseconds), and largely depends on the surrounding code and what the optimizer does.
If this is isolated code inside a function, you are unlikely to have a register cache problem. If threadSuspended is declared volatile , you will not have a problem either, as the optimizer will not register volatile cache files.
source share