perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r23792 - trunk/src/pmc

Subject: [svn:parrot] r23792 - trunk/src/pmc
From:
Date: Wed, 12 Dec 2007 07:23:45 -0800 PST
Newsgroups: perl.cvs.parrot

Author: allison
Date: Wed Dec 12 07:23:42 2007
New Revision: 23792

Modified:
   trunk/src/pmc/scheduler.pmc

Log:
[concurrency] Resolving synchronization problem, new event must not send wake
signal to scheduler at critical point of runloop (between checking for events,
and sleeping), because the wake signal will be missed.


Modified: trunk/src/pmc/scheduler.pmc
==============================================================================
--- trunk/src/pmc/scheduler.pmc (original)
+++ trunk/src/pmc/scheduler.pmc Wed Dec 12 07:23:42 2007
@@ -117,12 +117,13 @@
 
         core_struct->max_tid++;
         VTABLE_set_integer_native(INTERP, task, core_struct->max_tid);
-
         task_id_str = string_from_int(INTERP, core_struct->max_tid);
-        VTABLE_set_pmc_keyed_str(INTERP, core_struct->task_list, task_id_str, 
task);
 
+        LOCK(core_struct->lock);
+        VTABLE_set_pmc_keyed_str(INTERP, core_struct->task_list, task_id_str, 
task);
         VTABLE_push_integer(INTERP, core_struct->task_index, 
core_struct->max_tid);
         Parrot_cx_runloop_wake(core_struct->interp, SELF);
+        UNLOCK(core_struct->lock);
     }
 
 /*

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r23792 - trunk/src/pmc, allison <=