| Index: runtime/bin/thread_macos.cc
|
| diff --git a/runtime/bin/thread_macos.cc b/runtime/bin/thread_macos.cc
|
| index 9477e8ab4a834322439b87c6cbb2b9dc59e3110e..b63b0b929cd61feaadc6bbf1c3e1c962b471d7ff 100644
|
| --- a/runtime/bin/thread_macos.cc
|
| +++ b/runtime/bin/thread_macos.cc
|
| @@ -8,16 +8,16 @@
|
| #include "bin/thread.h"
|
| #include "bin/thread_macos.h"
|
|
|
| -#include <mach/mach_host.h> // NOLINT
|
| -#include <mach/mach_init.h> // NOLINT
|
| -#include <mach/mach_port.h> // NOLINT
|
| -#include <mach/mach_traps.h> // NOLINT
|
| -#include <mach/task_info.h> // NOLINT
|
| -#include <mach/thread_act.h> // NOLINT
|
| +#include <mach/mach_host.h> // NOLINT
|
| +#include <mach/mach_init.h> // NOLINT
|
| +#include <mach/mach_port.h> // NOLINT
|
| +#include <mach/mach_traps.h> // NOLINT
|
| +#include <mach/task_info.h> // NOLINT
|
| +#include <mach/thread_act.h> // NOLINT
|
| #include <mach/thread_info.h> // NOLINT
|
| -#include <sys/errno.h> // NOLINT
|
| -#include <sys/sysctl.h> // NOLINT
|
| -#include <sys/types.h> // NOLINT
|
| +#include <sys/errno.h> // NOLINT
|
| +#include <sys/sysctl.h> // NOLINT
|
| +#include <sys/types.h> // NOLINT
|
|
|
| #include "platform/assert.h"
|
| #include "platform/utils.h"
|
| @@ -25,37 +25,36 @@
|
| namespace dart {
|
| namespace bin {
|
|
|
| -#define VALIDATE_PTHREAD_RESULT(result) \
|
| - if (result != 0) { \
|
| - const int kBufferSize = 1024; \
|
| - char error_message[kBufferSize]; \
|
| - Utils::StrError(result, error_message, kBufferSize); \
|
| - FATAL2("pthread error: %d (%s)", result, error_message); \
|
| +#define VALIDATE_PTHREAD_RESULT(result) \
|
| + if (result != 0) { \
|
| + const int kBufferSize = 1024; \
|
| + char error_message[kBufferSize]; \
|
| + Utils::StrError(result, error_message, kBufferSize); \
|
| + FATAL2("pthread error: %d (%s)", result, error_message); \
|
| }
|
|
|
|
|
| #ifdef DEBUG
|
| -#define RETURN_ON_PTHREAD_FAILURE(result) \
|
| - if (result != 0) { \
|
| - const int kBufferSize = 1024; \
|
| - char error_message[kBufferSize]; \
|
| - Utils::StrError(result, error_message, kBufferSize); \
|
| - fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
|
| - __FILE__, __LINE__, result, error_message); \
|
| - return result; \
|
| +#define RETURN_ON_PTHREAD_FAILURE(result) \
|
| + if (result != 0) { \
|
| + const int kBufferSize = 1024; \
|
| + char error_message[kBufferSize]; \
|
| + Utils::StrError(result, error_message, kBufferSize); \
|
| + fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", __FILE__, __LINE__, \
|
| + result, error_message); \
|
| + return result; \
|
| }
|
| #else
|
| -#define RETURN_ON_PTHREAD_FAILURE(result) \
|
| - if (result != 0) { \
|
| - return result; \
|
| +#define RETURN_ON_PTHREAD_FAILURE(result) \
|
| + if (result != 0) { \
|
| + return result; \
|
| }
|
| #endif
|
|
|
|
|
| class ThreadStartData {
|
| public:
|
| - ThreadStartData(Thread::ThreadStartFunction function,
|
| - uword parameter)
|
| + ThreadStartData(Thread::ThreadStartFunction function, uword parameter)
|
| : function_(function), parameter_(parameter) {}
|
|
|
| Thread::ThreadStartFunction function() const { return function_; }
|
| @@ -311,9 +310,8 @@ Monitor::WaitResult Monitor::WaitMicros(int64_t micros) {
|
| (micros - (secs * kMicrosecondsPerSecond)) * kNanosecondsPerMicrosecond;
|
| ts.tv_sec = static_cast<int32_t>(secs);
|
| ts.tv_nsec = static_cast<long>(nanos); // NOLINT (long used in timespec).
|
| - int result = pthread_cond_timedwait_relative_np(data_.cond(),
|
| - data_.mutex(),
|
| - &ts);
|
| + int result =
|
| + pthread_cond_timedwait_relative_np(data_.cond(), data_.mutex(), &ts);
|
| ASSERT((result == 0) || (result == ETIMEDOUT));
|
| if (result == ETIMEDOUT) {
|
| retval = kTimedOut;
|
|
|