Comment on In the C++ bag of tricks: scoped locksparentComments−VikingCoder12yThen you still can't forget and do this: lock(lk_var) lock(lk_var2) { lk_var = lk_var2; } Or this: lock(lk_var) { lock(lk_var2 { lk_var = lk_var2; } } Using the pre-processor to solve a regular, every day, hum-drum, solved-a-billion-times RAII problem is bad news.
Comments
Then you still can't forget and do this:
Or this: Using the pre-processor to solve a regular, every day, hum-drum, solved-a-billion-times RAII problem is bad news.