2022-07-04 17:00:11 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "Mutex.h"
|
|
|
|
|
|
|
|
#if defined(XP_DARWIN)
|
|
|
|
|
|
|
|
// static
|
2022-08-24 12:18:57 +03:00
|
|
|
bool Mutex::SpinInKernelSpace() {
|
2023-02-14 11:46:59 +03:00
|
|
|
# ifdef __aarch64__
|
|
|
|
return true;
|
|
|
|
# else
|
2022-07-04 17:00:11 +03:00
|
|
|
if (__builtin_available(macOS 10.15, *)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2023-02-14 11:46:59 +03:00
|
|
|
# endif
|
2022-07-04 17:00:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2023-02-14 11:46:59 +03:00
|
|
|
const bool Mutex::gSpinInKernelSpace = SpinInKernelSpace();
|
2022-07-04 17:00:11 +03:00
|
|
|
|
|
|
|
#endif // defined(XP_DARWIN)
|