-void xbt_tpool_queue_job(xbt_tpool_t tpool, void_f_pvoid_t fun, void* fun_arg)
-{
- s_xbt_tpool_job_t job;
- job.fun = fun;
- job.fun_arg = fun_arg;
-
- /* Wait until we can lock on the pool with some space on it for the job */
- xbt_os_mutex_acquire(tpool->mutex);
- while(xbt_dynar_length(tpool->jobs_queue) == tpool->max_jobs)
- xbt_os_cond_wait(tpool->job_taken, tpool->mutex);
-
- DEBUG3("Queue job %p (%p) to thread pool %p", fun, fun_arg, tpool);
-
- /* Push the job in the queue, signal the workers and unlock the pool */
- xbt_dynar_push_as(tpool->jobs_queue, s_xbt_tpool_job_t, job);
- xbt_os_cond_signal(tpool->job_posted);
- xbt_os_mutex_release(tpool->mutex);
- return;
+unsigned long xbt_parmap_get_worker_id(xbt_parmap_t parmap) {
+ return (unsigned long) xbt_os_thread_get_extra_data();