Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use the extra data field of the xbt_os_thread to store the worker id.
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 1 Feb 2011 12:37:25 +0000 (12:37 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 1 Feb 2011 12:37:25 +0000 (12:37 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9549 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/parmap.c

index fcf8857..8492f38 100644 (file)
@@ -95,6 +95,7 @@ static void *_xbt_parmap_worker_main(void *arg)
 
   /* Fetch a worker id */
   worker_id = __sync_fetch_and_add(&parmap->workers_max_id, 1);
+  xbt_os_thread_set_extra_data((void *)(unsigned long)worker_id);
 
   DEBUG1("New worker thread created (%u)", worker_id);