Re: [RFC PATCH 2.6.17-mm1 4/3] ieee1394: convert ieee1394_transactionsfrom semaphores to waitqueue

From: Stefan Richter
Date: Sun Jun 25 2006 - 13:27:21 EST


I wrote on 2006-06-24:
+ return wait_event_interruptible(tlabel_wq,
+ !hpsb_get_tlabel_atomic(packet));

Hmm. "Linux Device Drivers" says about wait_event_interruptible(wq, condition): ''Note that @condition may be evaluated an arbitrary number of times, so it should not have any side effects.''

Alas the hpsb_get_tlabel_atomic() _does_ have a side effect, but only when !hpsb_get_tlabel_atomic(packet) is true.

The current implementation of wait_event_interruptible() seems to evaluate @condition multiple times if it is false but only _once_ while it is true. May I rely on this fact or do I have to rewrite the condition to be completely free of side effects?

I don't believe there would be ever a sensible implementation of wait_event_interruptible() which would evaluate @condition again after it became true.

Thanks,
--
Stefan Richter
-=====-=-==- -==- ==--=
http://arcgraph.de/sr/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/