Backed out 2 changesets (bug 1670885) for causing cppunit test failures. CLOSED TREE

Backed out changeset d220d82e1b81 (bug 1670885)
Backed out changeset bf5d0e1ffcfd (bug 1670885)
This commit is contained in:
Marian-Vasile Laza 2022-05-07 14:04:56 +03:00
Родитель f64962f4cd
Коммит 1b235627d5
2 изменённых файлов: 6 добавлений и 56 удалений

Просмотреть файл

@ -59,10 +59,6 @@
#ifdef XP_LINUX
# include <sys/prctl.h>
#endif
#ifdef XP_DARWIN
# include <crt_externs.h> // for _NSGetEnviron()
# include <spawn.h> // for posix_spawn() and friends
#endif
#include "jsapi.h"
#include "jsfriendapi.h"
@ -6670,52 +6666,6 @@ static bool CompileAndSerializeInSeparateProcess(JSContext* cx,
if (childPid == -1) {
return false;
}
# elif defined(XP_DARWIN)
// The file actions below will happen in the child process as if they were
// executed right after fork() returned and before execve() is called.
// Redirect stdin/stdout to the respective ends of the pipes. Closing
// stdIn.writer() is necessary for stdin to hit EOF. If the operations fail
// in the child process they will be reported after posix_spawn() has
// returned.
posix_spawn_file_actions_t file_actions;
if (posix_spawn_file_actions_init(&file_actions) != 0) {
return false;
}
if (posix_spawn_file_actions_adddup2(&file_actions, stdIn.reader(),
STDIN_FILENO) != 0) {
return false;
}
if (posix_spawn_file_actions_adddup2(&file_actions, stdOut.writer(),
STDOUT_FILENO) != 0) {
return false;
}
if (posix_spawn_file_actions_addclose(&file_actions, stdIn.reader()) != 0) {
return false;
}
if (posix_spawn_file_actions_addclose(&file_actions, stdIn.writer()) != 0) {
return false;
}
if (posix_spawn_file_actions_addclose(&file_actions, stdOut.reader()) != 0) {
return false;
}
if (posix_spawn_file_actions_addclose(&file_actions, stdOut.writer()) != 0) {
return false;
}
pid_t childPid = 0;
int rv = posix_spawn(&childPid, sArgv[0], &file_actions,
/* attrp */ nullptr, argv.get(), *_NSGetEnviron());
(void)posix_spawn_file_actions_destroy(&file_actions);
if (rv != 0) {
return false;
}
# else
pid_t childPid = fork();
switch (childPid) {

Просмотреть файл

@ -10,7 +10,7 @@
#if defined(XP_WIN)
# include <windows.h>
#elif defined(XP_DARWIN)
# include <os/lock.h>
# include <libkern/OSAtomic.h>
#else
# include <pthread.h>
#endif
@ -24,7 +24,7 @@ struct Mutex {
#if defined(XP_WIN)
CRITICAL_SECTION mMutex;
#elif defined(XP_DARWIN)
os_unfair_lock mMutex;
OSSpinLock mMutex;
#else
pthread_mutex_t mMutex;
#endif
@ -36,7 +36,7 @@ struct Mutex {
return false;
}
#elif defined(XP_DARWIN)
mMutex = OS_UNFAIR_LOCK_INIT;
mMutex = OS_SPINLOCK_INIT;
#elif defined(XP_LINUX) && !defined(ANDROID)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0) {
@ -60,7 +60,7 @@ struct Mutex {
#if defined(XP_WIN)
EnterCriticalSection(&mMutex);
#elif defined(XP_DARWIN)
os_unfair_lock_lock(&mMutex);
OSSpinLockLock(&mMutex);
#else
pthread_mutex_lock(&mMutex);
#endif
@ -70,7 +70,7 @@ struct Mutex {
#if defined(XP_WIN)
LeaveCriticalSection(&mMutex);
#elif defined(XP_DARWIN)
os_unfair_lock_unlock(&mMutex);
OSSpinLockUnlock(&mMutex);
#else
pthread_mutex_unlock(&mMutex);
#endif
@ -101,7 +101,7 @@ struct StaticMutex {
typedef Mutex StaticMutex;
# if defined(XP_DARWIN)
# define STATIC_MUTEX_INIT OS_UNFAIR_LOCK_INIT
# define STATIC_MUTEX_INIT OS_SPINLOCK_INIT
# elif defined(XP_LINUX) && !defined(ANDROID)
# define STATIC_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
# else