summaryrefslogtreecommitdiff
path: root/concurrency.c
diff options
context:
space:
mode:
Diffstat (limited to 'concurrency.c')
-rw-r--r--concurrency.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/concurrency.c b/concurrency.c
index 31464f7..3eb6685 100644
--- a/concurrency.c
+++ b/concurrency.c
@@ -86,6 +86,7 @@ void
messagesend(Array *a, int id)
{
ThreadData *td = nil;
+ ThreadData *selftd = getthreaddata();
lock(&threadlock);
for(int i = 0; i < nthreads && td == nil; i++)
if(threads[i]->id == id)
@@ -94,7 +95,10 @@ messagesend(Array *a, int id)
if(td != nil){
qlock(&td->lock);
Mail *newmail = emalloc(sizeof(Mail));
- newmail->contents = fnSame(a);
+ newmail->contents = allocarray(AtypeArray, 1, 2);
+ newmail->contents->shape[0] = 2;
+ newmail->contents->arraydata[0] = mkscalarint(selftd->id);
+ newmail->contents->arraydata[1] = fnSame(a);
newmail->next = 0;
if(td->lastmail != nil)
td->lastmail->next = newmail;