Michael> I do lock/unlock *after* refcount is 0: after wait_event.
Michael> Please tell me what I am missing.
Sorry, I misread your patch and then miscopied it somehow.
You're right, it would work.
But I think changing atomic_t to an integer protected by a lock it
much cleaner anyway.
- R.