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

Function wait_on_queue

mysys/mf_keycache.c:876–904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874*/
875
876static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
877 mysql_mutex_t *mutex)
878{
879 struct st_my_thread_var *last;
880 struct st_my_thread_var *thread= my_thread_var;
881
882 /* Add to queue. */
883 DBUG_ASSERT(!thread->next);
884 DBUG_ASSERT(!thread->prev); /* Not required, but must be true anyway. */
885 if (! (last= wqueue->last_thread))
886 thread->next= thread;
887 else
888 {
889 thread->next= last->next;
890 last->next= thread;
891 }
892 wqueue->last_thread= thread;
893
894 /*
895 Wait until thread is removed from queue by the signalling thread.
896 The loop protects against stray signals.
897 */
898 do
899 {
900 KEYCACHE_DBUG_PRINT("wait", ("suspend thread %ld", thread->id));
901 keycache_pthread_cond_wait(&thread->suspend, mutex);
902 }
903 while (thread->next);
904}
905
906
907/*

Callers 6

resize_key_cacheFunction · 0.85
find_key_blockFunction · 0.85
read_blockFunction · 0.85
key_cache_readFunction · 0.85
key_cache_writeFunction · 0.85
flush_key_blocks_intFunction · 0.85

Calls 1

Tested by

no test coverage detected