File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,11 @@ static struct rfcomm_session *rfcomm_session_del(struct rfcomm_session *s);
101
101
#define __get_rpn_stop_bits (line ) (((line) >> 2) & 0x1)
102
102
#define __get_rpn_parity (line ) (((line) >> 3) & 0x7)
103
103
104
+ static DECLARE_WAIT_QUEUE_HEAD (rfcomm_wq );
105
+
104
106
static void rfcomm_schedule (void )
105
107
{
106
- if (!rfcomm_thread )
107
- return ;
108
- wake_up_process (rfcomm_thread );
108
+ wake_up_all (& rfcomm_wq );
109
109
}
110
110
111
111
/* ---- RFCOMM FCS computation ---- */
@@ -2086,24 +2086,22 @@ static void rfcomm_kill_listener(void)
2086
2086
2087
2087
static int rfcomm_run (void * unused )
2088
2088
{
2089
+ DEFINE_WAIT_FUNC (wait , woken_wake_function );
2089
2090
BT_DBG ("" );
2090
2091
2091
2092
set_user_nice (current , -10 );
2092
2093
2093
2094
rfcomm_add_listener (BDADDR_ANY );
2094
2095
2095
- while (1 ) {
2096
- set_current_state (TASK_INTERRUPTIBLE );
2097
-
2098
- if (kthread_should_stop ())
2099
- break ;
2096
+ add_wait_queue (& rfcomm_wq , & wait );
2097
+ while (!kthread_should_stop ()) {
2100
2098
2101
2099
/* Process stuff */
2102
2100
rfcomm_process_sessions ();
2103
2101
2104
- schedule ( );
2102
+ wait_woken ( & wait , TASK_INTERRUPTIBLE , MAX_SCHEDULE_TIMEOUT );
2105
2103
}
2106
- __set_current_state ( TASK_RUNNING );
2104
+ remove_wait_queue ( & rfcomm_wq , & wait );
2107
2105
2108
2106
rfcomm_kill_listener ();
2109
2107
You can’t perform that action at this time.
0 commit comments