Example Active Object (Cont.) Lets assume we have some data structure for the queue itself, like we did for the requests pool in earlier examples. We assume the queue struct has a mutex and a condition variable. Lets see the code of the internal thread's function: void* intern_thread_func(void* data) { struct cmd_queue* q = (struct cmd_queue*)data; struct cmd* cmd; int done = 0; pthread_mutex_lock(&q->mutex); while (!done) { while (q_size(q) == 0) { pthread_cond_wait(&q->cond, &q->mutex); } cmd = q_pop(q);