changeset 934:296be5d6d524

change flag
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 01 Feb 2021 15:46:05 +0900
parents 03b02b9b7d1e
children 40735db036d3
files src/parallel_execution/examples/DPPMC/McDPP.cbc
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/examples/DPPMC/McDPP.cbc	Mon Feb 01 14:55:12 2021 +0900
+++ b/src/parallel_execution/examples/DPPMC/McDPP.cbc	Mon Feb 01 15:46:05 2021 +0900
@@ -2,12 +2,16 @@
 
 void mcDPP(struct MCTaskManagerImpl* mcti, struct MCWorker* mcWorker, StateDB now,StateDB next) {
   PhilsImpl* phils = (PhilsImpl*)GearImpl(mcWorker->mcContext, Phils, phils);
+  int prev_now = now->flag; 
+  int prev_next = next->flag; 
   if (phils->self != 1) return;
   enum Code nextc = mcWorker->mcContext->next;
-  if (nextc == C_eatingPhilsImpl ) {
-    next->flag |= t_eating; mcWorker->change = 1;
+  if (nextc == C_putdown_rforkPhilsImpl ) {
+    next->flag |= t_eating; 
   }
   if ((next->flag & t_eating )||(next->flag & t_F_eating) ) {
-    now->flag |= t_F_eating; mcWorker->change = 1;
+    now->flag |= t_F_eating; 
   }
+  if ( prev_now != now->flag || prev_next != next->flag )
+     mcWorker->change = 1;
 }