Rev 1407 | Rev 1427 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1407 | Rev 1408 | ||
---|---|---|---|
Line 226... | Line 226... | ||
226 | */ |
226 | */ |
227 | static int connection_thread(void *arg) |
227 | static int connection_thread(void *arg) |
228 | { |
228 | { |
229 | unsigned long key; |
229 | unsigned long key; |
230 | msg_t *msg; |
230 | msg_t *msg; |
- | 231 | connection_t *conn; |
|
231 | 232 | ||
232 | /* Setup thread local connection pointer */ |
233 | /* Setup thread local connection pointer */ |
233 | PS_connection = (connection_t *)arg; |
234 | PS_connection = (connection_t *)arg; |
- | 235 | conn = PS_connection; |
|
234 | PS_connection->cthread(PS_connection->callid, &PS_connection->call); |
236 | conn->cthread(conn->callid, &conn->call); |
235 | 237 | ||
236 | /* Remove myself from connection hash table */ |
238 | /* Remove myself from connection hash table */ |
237 | futex_down(&conn_futex); |
239 | futex_down(&conn_futex); |
238 | key = PS_connection->in_phone_hash; |
240 | key = conn->in_phone_hash; |
239 | hash_table_remove(&conn_hash_table, &key, 1); |
241 | hash_table_remove(&conn_hash_table, &key, 1); |
240 | futex_up(&conn_futex); |
242 | futex_up(&conn_futex); |
241 | /* Answer all remaining messages with ehangup */ |
243 | /* Answer all remaining messages with ehangup */ |
242 | while (!list_empty(&PS_connection->msg_queue)) { |
244 | while (!list_empty(&conn->msg_queue)) { |
243 | msg = list_get_instance(PS_connection->msg_queue.next, msg_t, link); |
245 | msg = list_get_instance(conn->msg_queue.next, msg_t, link); |
244 | list_remove(&msg->link); |
246 | list_remove(&msg->link); |
245 | ipc_answer_fast(msg->callid, EHANGUP, 0, 0); |
247 | ipc_answer_fast(msg->callid, EHANGUP, 0, 0); |
246 | free(msg); |
248 | free(msg); |
247 | } |
249 | } |
248 | } |
250 | } |