comparison dpp3.cbc @ 10:35d0358b3fe6

update Modern CbC Compiler
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 01 Jul 2019 22:18:03 +0900
parents a15437a1e94c
children
comparison
equal deleted inserted replaced
9:cef74c1054c1 10:35d0358b3fe6
35 35
36 __code pickup_rfork(PhilsPtr self, TaskPtr current_task) 36 __code pickup_rfork(PhilsPtr self, TaskPtr current_task)
37 { 37 {
38 if (self->right_fork->owner == NULL) { 38 if (self->right_fork->owner == NULL) {
39 //printf("%d: pickup_rfork:%d\n", self->id, self->right_fork->id); 39 //printf("%d: pickup_rfork:%d\n", self->id, self->right_fork->id);
40 self->right_fork->owner = self; 40 self->right_fork->owner = self;
41 self->next = PutDownFork; 41 self->next = PutDownFork;
42 goto scheduler(self, current_task); 42 goto scheduler(self, current_task);
43 } else { 43 } else {
44 self->next = PickUpRightFork; 44 self->next = PickUpRightFork;
45 goto scheduler(self, current_task); 45 goto scheduler(self, current_task);
46 } 46 }
47 } 47 }
48 48
49 __code pickup_lfork(PhilsPtr self, TaskPtr current_task) 49 __code pickup_lfork(PhilsPtr self, TaskPtr current_task)
50 { 50 {
51 if (self->left_fork->owner == NULL) { 51 if (self->left_fork->owner == NULL) {
52 //printf("%d: pickup_lfork:%d\n", self->id, self->left_fork->id); 52 //printf("%d: pickup_lfork:%d\n", self->id, self->left_fork->id);
53 self->left_fork->owner = self; 53 self->left_fork->owner = self;
54 self->next = PickUpRightFork; 54 self->next = PickUpRightFork;
55 goto scheduler(self, current_task); 55 goto scheduler(self, current_task);
56 } else { 56 } else {
57 self->next = PickUpLeftFork; 57 self->next = PickUpLeftFork;
58 goto scheduler(self, current_task); 58 goto scheduler(self, current_task);
59 } 59 }
60 } 60 }
61 61
62 __code eating(PhilsPtr self, TaskPtr current_task) 62 __code eating(PhilsPtr self, TaskPtr current_task)
63 { 63 {