pthreads with shared work queue