From 08e9a99cb51c18ba6df94c865c5c8d264347c9d5 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 24 Jul 2009 19:03:33 -0600 Subject: [PATCH] don't abort if pthread_kill fails in MySystem::visit --- src/compile.cpp | 2 +- src/posix.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index 48ab0aebeb..b1f5e0111a 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -6254,7 +6254,7 @@ class MyProcessor: public Processor { collect(t, Heap::MinorCollection); } - return visitor.trace; + return visitor.trace ? visitor.trace : makeArray(t, 0); } virtual void initialize(BootImage* image, uint8_t* code, unsigned capacity) { diff --git a/src/posix.cpp b/src/posix.cpp index b2b3800eee..fd45942ec5 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -628,13 +628,16 @@ class MySystem: public System { visitTarget = target; int rv = pthread_kill(target->thread, VisitSignal); - expect(this, rv == 0); - while (visitTarget) visitLock->wait(t, 0); + if (rv == 0) { + while (visitTarget) visitLock->wait(t, 0); - threadVisitor = 0; + threadVisitor = 0; - return 0; + return 0; + } else { + return -1; + } } virtual uint64_t call(void* function, uintptr_t* arguments, uint8_t* types,