Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: runtime/vm/os_thread_fuchsia.cc

Issue 2154443002: [fuchsia] Update to new spelling of magenta syscalls (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/sdk/@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/os_fuchsia.cc ('k') | runtime/vm/virtual_memory_fuchsia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" // NOLINT 5 #include "platform/globals.h" // NOLINT
6 #if defined(TARGET_OS_FUCHSIA) 6 #if defined(TARGET_OS_FUCHSIA)
7 7
8 #include "vm/os_thread.h" 8 #include "vm/os_thread.h"
9 #include "vm/os_thread_fuchsia.h" 9 #include "vm/os_thread_fuchsia.h"
10 10
(...skipping 29 matching lines...) Expand all
40 return result; \ 40 return result; \
41 } 41 }
42 #else 42 #else
43 #define RETURN_ON_PTHREAD_FAILURE(result) \ 43 #define RETURN_ON_PTHREAD_FAILURE(result) \
44 if (result != 0) return result; 44 if (result != 0) return result;
45 #endif 45 #endif
46 46
47 47
48 static void ComputeTimeSpecMicros(struct timespec* ts, int64_t micros) { 48 static void ComputeTimeSpecMicros(struct timespec* ts, int64_t micros) {
49 // time in nanoseconds. 49 // time in nanoseconds.
50 mx_time_t now = _magenta_current_time(); 50 mx_time_t now = mx_current_time();
51 mx_time_t target = now + (micros * kNanosecondsPerMicrosecond); 51 mx_time_t target = now + (micros * kNanosecondsPerMicrosecond);
52 int64_t secs = target / kNanosecondsPerSecond; 52 int64_t secs = target / kNanosecondsPerSecond;
53 int64_t nanos = target - (secs * kNanosecondsPerSecond); 53 int64_t nanos = target - (secs * kNanosecondsPerSecond);
54 54
55 ts->tv_sec += secs; 55 ts->tv_sec += secs;
56 ts->tv_nsec += nanos; 56 ts->tv_nsec += nanos;
57 if (ts->tv_nsec >= kNanosecondsPerSecond) { 57 if (ts->tv_nsec >= kNanosecondsPerSecond) {
58 ts->tv_sec += 1; 58 ts->tv_sec += 1;
59 ts->tv_nsec -= kNanosecondsPerSecond; 59 ts->tv_nsec -= kNanosecondsPerSecond;
60 } 60 }
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 void Monitor::NotifyAll() { 427 void Monitor::NotifyAll() {
428 // When running with assertions enabled we track the owner. 428 // When running with assertions enabled we track the owner.
429 ASSERT(IsOwnedByCurrentThread()); 429 ASSERT(IsOwnedByCurrentThread());
430 int result = pthread_cond_broadcast(data_.cond()); 430 int result = pthread_cond_broadcast(data_.cond());
431 VALIDATE_PTHREAD_RESULT(result); 431 VALIDATE_PTHREAD_RESULT(result);
432 } 432 }
433 433
434 } // namespace dart 434 } // namespace dart
435 435
436 #endif // defined(TARGET_OS_FUCHSIA) 436 #endif // defined(TARGET_OS_FUCHSIA)
OLDNEW
« no previous file with comments | « runtime/vm/os_fuchsia.cc ('k') | runtime/vm/virtual_memory_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698