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

Unified Diff: runtime/bin/thread_fuchsia.cc

Issue 2154453002: Add runtime/bin/thread_fuchsia that binds to fuchsia's pthreads (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/thread_fuchsia.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/thread_fuchsia.cc
diff --git a/runtime/bin/thread_linux.cc b/runtime/bin/thread_fuchsia.cc
similarity index 95%
copy from runtime/bin/thread_linux.cc
copy to runtime/bin/thread_fuchsia.cc
index 6ea923ea13675fbb2d3e940c30af0af255a51c92..dda960946a07118e21b9857821382c8d454a9a40 100644
--- a/runtime/bin/thread_linux.cc
+++ b/runtime/bin/thread_fuchsia.cc
@@ -3,10 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(TARGET_OS_LINUX)
+#if defined(TARGET_OS_FUCHSIA)
#include "bin/thread.h"
-#include "bin/thread_linux.h"
+#include "bin/thread_fuchsia.h"
#include <errno.h> // NOLINT
#include <sys/resource.h> // NOLINT
@@ -168,13 +168,7 @@ bool Thread::Compare(ThreadId a, ThreadId b) {
void Thread::GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage) {
- ASSERT(thread_id == GetCurrentThreadId());
- ASSERT(cpu_usage != NULL);
- struct timespec ts;
- int r = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
- ASSERT(r == 0);
- *cpu_usage = (ts.tv_sec * kNanosecondsPerSecond + ts.tv_nsec) /
- kNanosecondsPerMicrosecond;
+ UNIMPLEMENTED();
}
@@ -334,4 +328,4 @@ void Monitor::NotifyAll() {
} // namespace bin
} // namespace dart
-#endif // defined(TARGET_OS_LINUX)
+#endif // defined(TARGET_OS_FUCHSIA)
« no previous file with comments | « runtime/bin/thread_fuchsia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698