Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263528
b: refs/heads/master
c: 7176522
h: refs/heads/master
v: v3
  • Loading branch information
Peter Hurley authored and Gustavo F. Padovan committed Aug 11, 2011
1 parent f7c0e32 commit 46eab55
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 751c10a56802513a6b057c8cf1552cecc1c9afde
refs/heads/master: 7176522cdca1f0b78a1434b41761f0334511822a
3 changes: 2 additions & 1 deletion trunk/net/bluetooth/cmtp/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ static void cmtp_reset_ctr(struct capi_ctr *ctrl)

capi_ctr_down(ctrl);

kthread_stop(session->task);
atomic_inc(&session->terminate);
wake_up_process(session->task);
}

static void cmtp_register_appl(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp)
Expand Down
1 change: 1 addition & 0 deletions trunk/net/bluetooth/cmtp/cmtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct cmtp_session {

char name[BTNAMSIZ];

atomic_t terminate;
struct task_struct *task;

wait_queue_head_t wait;
Expand Down
5 changes: 3 additions & 2 deletions trunk/net/bluetooth/cmtp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static int cmtp_session(void *arg)
while (1) {
set_current_state(TASK_INTERRUPTIBLE);

if (kthread_should_stop())
if (atomic_read(&session->terminate))
break;
if (sk->sk_state != BT_CONNECTED)
break;
Expand Down Expand Up @@ -416,7 +416,8 @@ int cmtp_del_connection(struct cmtp_conndel_req *req)
skb_queue_purge(&session->transmit);

/* Stop session thread */
kthread_stop(session->task);
atomic_inc(&session->terminate);
wake_up_process(session->task);
} else
err = -ENOENT;

Expand Down

0 comments on commit 46eab55

Please sign in to comment.