MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / link_into_queue

Function link_into_queue

mysys/mf_keycache.c:789–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787*/
788
789static 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

Callers 2

get_hash_linkFunction · 0.85
find_key_blockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected