mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-09 02:43:21 +00:00
Reset es_action field when idle ws engine receives a notification.
In MR_do_idle_worksteal, reset the engine's es_action field to MR_ENGINE_ACTION_NONE before performing the notified action. This mirrors the behaviour in MR_do_sleep. Fixes the assertion failure in Mantis bug #461: when an engine is shut down, MR_verify_final_engine_sleep_sync checks that the engine's es_action field is MR_ENGINE_ACTION_NONE. runtime/mercury_context.c: As above. NEWS: Announce change.
This commit is contained in:
3
NEWS
3
NEWS
@@ -263,6 +263,9 @@ Changes to the Mercury implementation
|
||||
|
||||
* We have upgraded the bundled Boehm GC to v7.6.12 and libatomic_ops to v7.6.8.
|
||||
|
||||
* [Mantis bug #461]. We have fixed an assertion failure affecting programs
|
||||
in low-level C parallel grades as they exit.
|
||||
|
||||
NEWS for Mercury 20.01.2
|
||||
========================
|
||||
|
||||
|
||||
@@ -2279,6 +2279,7 @@ MR_define_entry(MR_do_idle_worksteal);
|
||||
MR_Code *jump_target;
|
||||
MR_EngineId engine_id = MR_ENGINE(MR_eng_id);
|
||||
engine_sleep_sync *esync = get_engine_sleep_sync(engine_id);
|
||||
unsigned action;
|
||||
|
||||
// Only work-stealing engines beyond this point.
|
||||
MR_assert(MR_ENGINE(MR_eng_type) == MR_ENGINE_TYPE_SHARED);
|
||||
@@ -2290,8 +2291,10 @@ MR_define_entry(MR_do_idle_worksteal);
|
||||
}
|
||||
|
||||
// The compare and swap failed, which means there is a notification.
|
||||
action = esync->d.es_action;
|
||||
esync->d.es_action = MR_ENGINE_ACTION_NONE;
|
||||
|
||||
switch (esync->d.es_action) {
|
||||
switch (action) {
|
||||
case MR_ENGINE_ACTION_SHUTDOWN:
|
||||
action_shutdown_ws_engine();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user