/* -*- mode: C; c-basic-offset: 4 -*- */ #include #include #include "toku_portability.h" #include "toku_assert.h" #include "toku_os.h" #include "toku_pthread.h" #include "workqueue.h" #include "threadpool.h" #include "toku_worker.h" // Create fixed number of worker threads, all waiting on a single queue // of work items (WORKQUEUE). void toku_init_workers(WORKQUEUE wq, THREADPOOL *tpptr) { workqueue_init(wq); int nprocs = toku_os_get_number_active_processors(); threadpool_create(tpptr, nprocs); int i; for (i=0; if(wi); // call the work handler function } // printf("%lu:%s:exit %p\n", toku_pthread_self(), __FUNCTION__, arg); return arg; }