Hacker News new | ask | show | jobs
by infogulch 4510 days ago
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.
1 comments

This is so wrong on so many levels.
It's not any worse than what was suggested in the linked article...