News for hackers. Stuff that matters.
Re:In the C++ bag of tricks: scoped locks by infogulch on Friday February 07, 2014 @12:14PM (#7197370)
What about:

     #define LOCKED(lk) for(int i=lk_lock(lk); i == 0; lk_unlock(lk), i++)
Probably better to test for 0 exactly, in case it fails. You don't want it to unlock twice just because it returns -1.
Re:In the C++ bag of tricks: scoped locks by eps on Friday February 07, 2014 @02:28PM (#7198197)
This is so wrong on so many levels.
Re:In the C++ bag of tricks: scoped locks by infogulch on Friday February 07, 2014 @05:42PM (#7199264)
It's not any worse than what was suggested in the linked article...