Y
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
eps
4510 days ago
This is so wrong on so many levels.
link
infogulch
4510 days ago
It's not any worse than what was suggested in the linked article...
link