|
@@ -38,8 +38,8 @@
|
|
* all wakeups are TASK_NORMAL in order to avoid O(n) lookups for the right
|
|
* all wakeups are TASK_NORMAL in order to avoid O(n) lookups for the right
|
|
* sleeper state.
|
|
* sleeper state.
|
|
*
|
|
*
|
|
- * - the exclusive mode; because this requires preserving the list order
|
|
|
|
- * and this is hard.
|
|
|
|
|
|
+ * - the !exclusive mode; because that leads to O(n) wakeups, everything is
|
|
|
|
+ * exclusive.
|
|
*
|
|
*
|
|
* - custom wake callback functions; because you cannot give any guarantees
|
|
* - custom wake callback functions; because you cannot give any guarantees
|
|
* about random code. This also allows swait to be used in RT, such that
|
|
* about random code. This also allows swait to be used in RT, such that
|
|
@@ -167,9 +167,10 @@ extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queu
|
|
extern void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
|
extern void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
|
extern void finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
|
extern void finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
|
|
|
|
|
-/* as per ___wait_event() but for swait, therefore "exclusive == 0" */
|
|
|
|
|
|
+/* as per ___wait_event() but for swait, therefore "exclusive == 1" */
|
|
#define ___swait_event(wq, condition, state, ret, cmd) \
|
|
#define ___swait_event(wq, condition, state, ret, cmd) \
|
|
({ \
|
|
({ \
|
|
|
|
+ __label__ __out; \
|
|
struct swait_queue __wait; \
|
|
struct swait_queue __wait; \
|
|
long __ret = ret; \
|
|
long __ret = ret; \
|
|
\
|
|
\
|
|
@@ -182,13 +183,13 @@ extern void finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
|
|
\
|
|
\
|
|
if (___wait_is_interruptible(state) && __int) { \
|
|
if (___wait_is_interruptible(state) && __int) { \
|
|
__ret = __int; \
|
|
__ret = __int; \
|
|
- break; \
|
|
|
|
|
|
+ goto __out; \
|
|
} \
|
|
} \
|
|
\
|
|
\
|
|
cmd; \
|
|
cmd; \
|
|
} \
|
|
} \
|
|
finish_swait(&wq, &__wait); \
|
|
finish_swait(&wq, &__wait); \
|
|
- __ret; \
|
|
|
|
|
|
+__out: __ret; \
|
|
})
|
|
})
|
|
|
|
|
|
#define __swait_event(wq, condition) \
|
|
#define __swait_event(wq, condition) \
|