Rev 3620 | Rev 3870 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3620 | Rev 3867 | ||
|---|---|---|---|
| Line 126... | Line 126... | ||
| 126 | IPC_SET_RETVAL(call->data, 0); |
126 | IPC_SET_RETVAL(call->data, 0); |
| 127 | ipc_answer(&TASK->kb.box, call); |
127 | ipc_answer(&TASK->kb.box, call); |
| 128 | 128 | ||
| 129 | ipl = interrupts_disable(); |
129 | ipl = interrupts_disable(); |
| 130 | spinlock_lock(&TASK->lock); |
130 | spinlock_lock(&TASK->lock); |
| 131 | spinlock_lock(&TASK->answerbox.lock); |
131 | spinlock_lock(&TASK->kb.box.lock); |
| 132 | if (list_empty(&TASK->answerbox.connected_phones)) { |
132 | if (list_empty(&TASK->kb.box.connected_phones)) { |
| 133 | /* |
133 | /* |
| 134 | * Last phone has been disconnected. Detach this thread so it |
134 | * Last phone has been disconnected. Detach this thread so it |
| 135 | * gets freed and signal to the caller. |
135 | * gets freed and signal to the caller. |
| 136 | */ |
136 | */ |
| 137 | 137 | ||
| Line 148... | Line 148... | ||
| 148 | *last = true; |
148 | *last = true; |
| 149 | } else { |
149 | } else { |
| 150 | *last = false; |
150 | *last = false; |
| 151 | } |
151 | } |
| 152 | 152 | ||
| 153 | spinlock_unlock(&TASK->answerbox.lock); |
153 | spinlock_unlock(&TASK->kb.box.lock); |
| 154 | spinlock_unlock(&TASK->lock); |
154 | spinlock_unlock(&TASK->lock); |
| 155 | interrupts_restore(ipl); |
155 | interrupts_restore(ipl); |
| 156 | } |
156 | } |
| 157 | 157 | ||
| 158 | /** Implementing function for the kbox thread. |
158 | /** Implementing function for the kbox thread. |