Skip to content

Commit 2836f32

Browse files
committed
Sulong: Clear thread objects on join instead of on task completion
1 parent edae1ca commit 2836f32

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sulong/projects/com.oracle.truffle.llvm.runtime/src/com/oracle/truffle/llvm/runtime/nodes/intrinsics/multithreading/LLVMPThreadStart.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public void run() {
9494
}
9595
}
9696
}
97-
pThreadContext.clearThreadID();
9897
}
9998
}
10099
}

sulong/projects/com.oracle.truffle.llvm.runtime/src/com/oracle/truffle/llvm/runtime/nodes/intrinsics/multithreading/LLVMPThreadThreadIntrinsics.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ protected Object doIntrinsic(long threadID,
107107
LLVMPThreadContext pthreadContext = context.getpThreadContext();
108108
Object threadReturnValue = pthreadContext.getThreadReturnValue(threadID);
109109
pthreadContext.clearThreadReturnValue(threadID);
110+
pthreadContext.clearThreadID(threadID);
110111
return threadReturnValue;
111112
}
112113
}

sulong/projects/com.oracle.truffle.llvm.runtime/src/com/oracle/truffle/llvm/runtime/pthread/LLVMPThreadContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ public Thread getThread(long threadID) {
210210
}
211211

212212
@TruffleBoundary
213-
public void clearThreadID() {
214-
threadStorage.remove(Thread.currentThread().getId());
213+
public void clearThreadID(long threadID) {
214+
threadStorage.remove(threadID);
215215
}
216216

217217
@TruffleBoundary

0 commit comments

Comments
 (0)