Mercurial > hg > GearsTemplate
comparison src/parallel_execution/main.c @ 166:06cfc1289361
fix
author | mir3636 |
---|---|
date | Fri, 18 Nov 2016 19:34:44 +0900 |
parents | 73c393f0dca3 |
children | ea7b11f3e717 |
comparison
equal
deleted
inserted
replaced
165:bf26f1105862 | 166:06cfc1289361 |
---|---|
144 &context->data[D_LoopCounter]->loopCounter, | 144 &context->data[D_LoopCounter]->loopCounter, |
145 task, | 145 task, |
146 waitMe, | 146 waitMe, |
147 waitI, | 147 waitI, |
148 &context->data[D_Element]->element, | 148 &context->data[D_Element]->element, |
149 &context->data[D_ActiveQueue]->queue); | 149 &context->data[D_ActiveQueue]->Queue); |
150 } | 150 } |
151 | 151 |
152 | 152 |
153 //__code createTask4(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Queue* waitMe, struct OdsQueue* waitI, struct Element* element, struct Queue* activeQueue) { | 153 //__code createTask4(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Queue* waitMe, struct OdsQueue* waitI, struct Element* element, struct Queue* activeQueue) { |
154 // int i = loopCounter->i; | 154 // int i = loopCounter->i; |
218 | 218 |
219 __code putQueue2_stub(struct Context* context) { | 219 __code putQueue2_stub(struct Context* context) { |
220 goto putQueue2(context, | 220 goto putQueue2(context, |
221 &context->data[context->dataNum]->element, | 221 &context->data[context->dataNum]->element, |
222 &context->data[D_Element]->element, | 222 &context->data[D_Element]->element, |
223 &context->data[D_Queue]->queue); | 223 &context->data[D_Queue]->Queue); |
224 } | 224 } |
225 | 225 |
226 __code putQueue3(struct Context* context, struct Queue* queue, struct Element* new_element) { | 226 __code putQueue3(struct Context* context, struct Queue* queue, struct Element* new_element) { |
227 struct Element* last = queue->last; | 227 struct Element* last = queue->last; |
228 | 228 |
235 goto meta(context, PutQueue3); | 235 goto meta(context, PutQueue3); |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 __code putQueue3_stub(struct Context* context) { | 239 __code putQueue3_stub(struct Context* context) { |
240 goto putQueue3(context, &context->data[D_Queue]->queue, &context->data[context->dataNum]->element); | 240 goto putQueue3(context, &context->data[D_Queue]->Queue, &context->data[context->dataNum]->element); |
241 } | 241 } |
242 | 242 |
243 __code putQueue4(struct Context* context, struct Queue* queue, struct Element* new_element) { | 243 __code putQueue4(struct Context* context, struct Queue* queue, struct Element* new_element) { |
244 if (__sync_bool_compare_and_swap(&queue->first, 0, new_element)) { | 244 if (__sync_bool_compare_and_swap(&queue->first, 0, new_element)) { |
245 queue->last = new_element; | 245 queue->last = new_element; |
250 goto meta(context, PutQueue3); | 250 goto meta(context, PutQueue3); |
251 } | 251 } |
252 } | 252 } |
253 | 253 |
254 __code putQueue4_stub(struct Context* context) { | 254 __code putQueue4_stub(struct Context* context) { |
255 goto putQueue4(context, &context->data[D_Queue]->queue, &context->data[context->dataNum]->element); | 255 goto putQueue4(context, &context->data[D_Queue]->Queue, &context->data[context->dataNum]->element); |
256 } | 256 } |
257 | 257 |
258 __code createWorker(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) { | 258 __code createWorker(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) { |
259 int i = loopCounter->i; | 259 int i = loopCounter->i; |
260 | 260 |