Skip to content
Browse files

[concurrency] Resolving synchronization problem, new event must not s…

…end wake

signal to scheduler at critical point of runloop (between checking for events,
and sleeping), because the wake signal will be missed.


git-svn-id: https://svn.parrot.org/parrot/trunk@23792 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent d6808fe commit df0a91e5d54e9cc23576a3016fab72c5f35fbbe4 @allisonrandal allisonrandal committed Dec 12, 2007
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/pmc/scheduler.pmc
View
5 src/pmc/scheduler.pmc
@@ -117,12 +117,13 @@ current maximum.
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);
}
/*

0 comments on commit df0a91e

Please sign in to comment.
Something went wrong with that request. Please try again.