Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74da9d88bf5ffd31aed61a0b19519684ad744ded
Commit:     74da9d88bf5ffd31aed61a0b19519684ad744ded
Parent:     9198d2220d29b87ac3a05a3b791c50bb8a014d63
Author:     Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 01:41:01 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Apr 26 01:41:01 2007 -0700

    [BLUETOOTH] rfcomm_worker(): fix wakeup race
    
    Set TASK_INTERRUPTIBLE prior to testing the flag to avoid missed wakeups.
    
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Acked-by: Marcel Holtmann <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 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 10cc13c..fe7df90 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;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to