-void *run_task(void *p)
-{
- thread_context_st *context= (thread_context_st *)p;
- memcached_st *memc;
-
- memc= context->memc;
-
- pthread_mutex_lock(&sleeper_mutex);
- while (master_wakeup)
- {
- pthread_cond_wait(&sleep_threshhold, &sleeper_mutex);
- }
- pthread_mutex_unlock(&sleeper_mutex);
-
- /* Do Stuff */
- switch (context->test)
- {
- case SET_TEST:
- assert(context->execute_pairs);
- execute_set(memc, context->execute_pairs, context->execute_number);
- break;
- case GET_TEST:
- execute_get(memc, context->initial_pairs, context->initial_number);
- break;
- case MGET_TEST:
- execute_mget(memc, (const char*const*)context->keys, context->key_lengths,
- context->initial_number);
- break;
- default:
- WATCHPOINT_ASSERT(context->test);
- break;
- }
-
- memcached_free(memc);
-
- if (context->execute_pairs)
- pairs_free(context->execute_pairs);
-
- free(context);
-
- pthread_mutex_lock(&counter_mutex);
- thread_counter--;
- pthread_cond_signal(&count_threshhold);
- pthread_mutex_unlock(&counter_mutex);
-
- return NULL;
-}
-