| 787 | */ |
| 788 | |
| 789 | static void link_into_queue(KEYCACHE_WQUEUE *wqueue, |
| 790 | struct st_my_thread_var *thread) |
| 791 | { |
| 792 | struct st_my_thread_var *last; |
| 793 | |
| 794 | DBUG_ASSERT(!thread->next && !thread->prev); |
| 795 | if (! (last= wqueue->last_thread)) |
| 796 | { |
| 797 | /* Queue is empty */ |
| 798 | thread->next= thread; |
| 799 | thread->prev= &thread->next; |
| 800 | } |
| 801 | else |
| 802 | { |
| 803 | thread->prev= last->next->prev; |
| 804 | last->next->prev= &thread->next; |
| 805 | thread->next= last->next; |
| 806 | last->next= thread; |
| 807 | } |
| 808 | wqueue->last_thread= thread; |
| 809 | } |
| 810 | |
| 811 | /* |
| 812 | Unlink a thread from double-linked queue of waiting threads |
no outgoing calls
no test coverage detected