Piotr Caban (@piotr) commented about dlls/msvcrt/concurrency.c:
- if (this->context)
- {
ThreadScheduler *scheduler = get_thread_scheduler_from_context(this->context);
if (scheduler)
pick_and_execute_chore(scheduler);
- }
- if (chore) {
if (chore->task_collection) {
invalid_multiple_scheduling e;
invalid_multiple_scheduling_ctor_str(&e, "Chore scheduled multiple times");
_CxxThrowException(&e, &invalid_multiple_scheduling_exception_type);
}
execute_chore(chore, this);
- }
pick_and_execute_chore executes only one scheduled chore. It should be done in a loop as long as there are more chores to execute. You're also executing chores in wrong order - chore passed as argument should be run first.