| 315 | } |
| 316 | |
| 317 | static rt_err_t wakeup_sender_wait_recv(void *object, struct rt_thread *thread) |
| 318 | { |
| 319 | rt_channel_t ch; |
| 320 | |
| 321 | ch = (rt_channel_t)object; |
| 322 | if (ch->stat == RT_IPC_STAT_ACTIVE && ch->reply == thread) |
| 323 | { |
| 324 | ch->stat = RT_IPC_STAT_IDLE; |
| 325 | ch->reply = RT_NULL; |
| 326 | } |
| 327 | else |
| 328 | { |
| 329 | rt_ipc_msg_t msg; |
| 330 | rt_list_t *l; |
| 331 | |
| 332 | l = ch->wait_msg.next; |
| 333 | while (l != &ch->wait_msg) |
| 334 | { |
| 335 | msg = rt_list_entry(l, struct rt_ipc_msg, mlist); |
| 336 | if (msg->need_reply && msg->msg.sender == thread) |
| 337 | { |
| 338 | rt_list_remove(&msg->mlist); /* remove the msg from the channel */ |
| 339 | _ipc_msg_free(msg); |
| 340 | break; |
| 341 | } |
| 342 | l = l->next; |
| 343 | } |
| 344 | } |
| 345 | thread->error = -RT_EINTR; |
| 346 | return rt_thread_resume(thread); /* wake up the sender */ |
| 347 | } |
| 348 | |
| 349 | static rt_err_t wakeup_sender_wait_reply(void *object, struct rt_thread *thread) |
| 350 | { |
nothing calls this directly
no test coverage detected