But some alternatives for you: You could have a local collection containing
the list of deleted records which can only be modified while you own the mutex on lockmap.
So you could then just check the deleted record in that collection without ever going to the RAF
thread could slice out from here, so this record could be deleted by other thread then this thread read a deleted record!
While you should always try to avoid nested synchronization, sometimes it is not possible to avoid it totally. As long as you always nest in the same order you should be OK.
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton