diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-04-26 10:41:01 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-26 10:41:01 +0200 |
commit | 74da9d88bf5ffd31aed61a0b19519684ad744ded (patch) | |
tree | 601509eaf04f387578ddc72015c0d7c62709e72a | |
parent | [NET]: bonding documentation fix for multiple bonding interfaces (diff) | |
download | linux-74da9d88bf5ffd31aed61a0b19519684ad744ded.tar.xz linux-74da9d88bf5ffd31aed61a0b19519684ad744ded.zip |
[BLUETOOTH] rfcomm_worker(): fix wakeup race
Set TASK_INTERRUPTIBLE prior to testing the flag to avoid missed wakeups.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 10cc13cfae6c..fe7df90eb707 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c @@ -1851,18 +1851,18 @@ static void rfcomm_worker(void) BT_DBG(""); while (!atomic_read(&terminate)) { + set_current_state(TASK_INTERRUPTIBLE); if (!test_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event)) { /* No pending events. Let's sleep. * Incoming connections and data will wake us up. */ - set_current_state(TASK_INTERRUPTIBLE); schedule(); } + set_current_state(TASK_RUNNING); /* Process stuff */ clear_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event); rfcomm_process_sessions(); } - set_current_state(TASK_RUNNING); return; } |