Mercurial > hg > Gears > Gears
changeset 940:f98fc785a397
fix McDPP flag
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 03 Feb 2021 09:05:27 +0900 |
parents | 2a5a348d82c6 |
children | 78966e75194f |
files | src/parallel_execution/examples/DPPMC/McDPP.cbc |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/examples/DPPMC/McDPP.cbc Mon Feb 01 20:37:12 2021 +0900 +++ b/src/parallel_execution/examples/DPPMC/McDPP.cbc Wed Feb 03 09:05:27 2021 +0900 @@ -5,16 +5,18 @@ 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_putdown_rforkPhilsImpl ) { + + if (phils->self == 1 && nextc == C_putdown_rforkPhilsImpl ) { next->flag |= t_eating; } if ((next->flag & t_eating )||(next->flag & t_F_eating) ) { now->flag |= t_F_eating; } + if ( prev_now != now->flag || prev_next != next->flag ) mcWorker->change = 1; + if (check) { if (!(now->flag & t_F_eating)) { printf("not <> eating\n");