31c3470dc0
The deadlock patch is most likely not limited to musl but its a race condition and it seems like with the current way how it works its only triggered with musl and with namespaces enabled. The other patch just makes pthreads in v8 use CLOCK_MONOTONIC like it does for glibc.
24 lines
1.1 KiB
Diff
24 lines
1.1 KiB
Diff
Use monotonic clock for pthread_cond_timedwait with musl too.
|
|
|
|
diff --git a/v8/src/base/platform/condition-variable.cc b/v8/src/base/platform/condition-variable.cc
|
|
index 5ea7083..c13027e 100644
|
|
--- ./v8/src/base/platform/condition-variable.cc
|
|
+++ ./v8/src/base/platform/condition-variable.cc
|
|
@@ -16,7 +16,7 @@ namespace base {
|
|
|
|
ConditionVariable::ConditionVariable() {
|
|
#if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
|
|
- (V8_OS_LINUX && V8_LIBC_GLIBC))
|
|
+ V8_OS_LINUX)
|
|
// On Free/Net/OpenBSD and Linux with glibc we can change the time
|
|
// source for pthread_cond_timedwait() to use the monotonic clock.
|
|
pthread_condattr_t attr;
|
|
@@ -92,7 +92,7 @@ bool ConditionVariable::WaitFor(Mutex* mutex, const TimeDelta& rel_time) {
|
|
&native_handle_, &mutex->native_handle(), &ts);
|
|
#else
|
|
#if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
|
|
- (V8_OS_LINUX && V8_LIBC_GLIBC))
|
|
+ V8_OS_LINUX)
|
|
// On Free/Net/OpenBSD and Linux with glibc we can change the time
|
|
// source for pthread_cond_timedwait() to use the monotonic clock.
|
|
result = clock_gettime(CLOCK_MONOTONIC, &ts);
|