Parcourir la source

backport libuv arm64 patch:
unix: check Android support for pthread_cond_timedwait_monotonic_np

See: https://github.com/joyent/libuv/commit/3e75042a2b582c88c236c0807ac5c8e4623d2395

Mada il y a 9 ans
Parent
commit
849772b312
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      node_build/dependencies/libuv/src/unix/thread.c

+ 2 - 2
node_build/dependencies/libuv/src/unix/thread.c

@@ -280,7 +280,7 @@ int uv_cond_init(uv_cond_t* cond) {
   if (err)
     return -err;
 
-#if !defined(__ANDROID__)
+#if !(defined(__ANDROID__) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
   err = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
   if (err)
     goto error2;
@@ -338,7 +338,7 @@ int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) {
   timeout += uv__hrtime(UV_CLOCK_PRECISE);
   ts.tv_sec = timeout / NANOSEC;
   ts.tv_nsec = timeout % NANOSEC;
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
   /*
    * The bionic pthread implementation doesn't support CLOCK_MONOTONIC,
    * but has this alternative function instead.