diff src/synchronizedQueue/synchronizedQueueContext.c @ 63:2a40d697bf4e

Delete while loop for cas
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Mon, 13 Jul 2015 23:20:31 +0900
parents 4283b87ddbf4
children a870c84acd0e
line wrap: on
line diff
--- a/src/synchronizedQueue/synchronizedQueueContext.c	Fri Jun 26 18:45:02 2015 +0900
+++ b/src/synchronizedQueue/synchronizedQueueContext.c	Mon Jul 13 23:20:31 2015 +0900
@@ -9,12 +9,18 @@
 extern __code code5_stub(struct Context*);
 extern __code code6_stub(struct Context*);
 extern __code code7_stub(struct Context*);
+extern __code code8_stub(struct Context*);
+extern __code code9_stub(struct Context*);
+extern __code code10_stub(struct Context*);
+extern __code code11_stub(struct Context*);
 extern __code meta(struct Context*);
 extern __code allocate(struct Context*);
 extern __code sender_stub(struct Context*);
 extern __code put_stub(struct Context*);
+extern __code continue_put_stub(struct Context*);
 extern __code receiver_stub(struct Context*);
 extern __code get_stub(struct Context*);
+extern __code continue_get_stub(struct Context*);
 extern __code exit_code(struct Context*);
 extern __code thread_exit_stub(struct Context*);
 
@@ -22,25 +28,31 @@
     context->dataSize   = sizeof(union Data)*ALLOCATE_SIZE;
     context->code       = malloc(sizeof(__code*)*ALLOCATE_SIZE);
     context->data       = malloc(sizeof(union Data*)*ALLOCATE_SIZE);
-    context->heap_start = malloc(context->dataSize);
+    context->heapStart = malloc(context->dataSize);
 
-    context->codeNum          = Exit;
-    context->code[Allocator]  = allocate;
-    context->code[Code1]      = code1_stub;
-    context->code[Code2]      = code2_stub;
-    context->code[Code3]      = code3_stub;
-    context->code[Code4]      = code4_stub;
-    context->code[Code5]      = code5_stub;
-    context->code[Code6]      = code6_stub;
-    context->code[Code7]      = code7_stub;
-    context->code[Sender]     = sender_stub;
-    context->code[Put]        = put_stub;
-    context->code[Receiver]   = receiver_stub;
-    context->code[Get]        = get_stub;
-    context->code[Exit]       = exit_code;
-    context->code[ThreadExit] = thread_exit_stub;
+    context->codeNum           = Exit;
+    context->code[Allocator]   = allocate;
+    context->code[Code1]       = code1_stub;
+    context->code[Code2]       = code2_stub;
+    context->code[Code3]       = code3_stub;
+    context->code[Code4]       = code4_stub;
+    context->code[Code5]       = code5_stub;
+    context->code[Code6]       = code6_stub;
+    context->code[Code7]       = code7_stub;
+    context->code[Code8]       = code8_stub;
+    context->code[Code9]       = code9_stub;
+    context->code[Code10]      = code10_stub;
+    context->code[Code11]      = code11_stub;
+    context->code[Sender]      = sender_stub;
+    context->code[Put]         = put_stub;
+    context->code[ContinuePut] = continue_put_stub;
+    context->code[Receiver]    = receiver_stub;
+    context->code[Get]         = get_stub;
+    context->code[ContinueGet] = continue_get_stub;
+    context->code[ThreadExit]  = thread_exit_stub;
+    context->code[Exit]        = exit_code;
 
-    context->heap = context->heap_start;
+    context->heap = context->heapStart;
 
     context->data[Allocate] = context->heap;
     context->heap          += sizeof(struct Allocate);