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

Unified Diff: runtime/vm/os_thread.h

Issue 2714083002: Revert "Fixed issue in MallocHooks where a MallocHookScope was accidentally removed during a merge,… (Closed)
Patch Set: Created 3 years, 10 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/vm/os_macos.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_thread.h
diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h
index 3130b25ef442ded9abf5351e5b07d283287a981e..a3693af4308fc901af326e7c946fc992f7f3add1 100644
--- a/runtime/vm/os_thread.h
+++ b/runtime/vm/os_thread.h
@@ -116,7 +116,7 @@ class OSThread : public BaseThread {
bool ThreadInterruptsEnabled();
// The currently executing thread, or NULL if not yet initialized.
- static OSThread* TryCurrent() {
+ static OSThread* Current() {
BaseThread* thread = GetCurrentTLS();
OSThread* os_thread = NULL;
if (thread != NULL) {
@@ -126,15 +126,7 @@ class OSThread : public BaseThread {
Thread* vm_thread = reinterpret_cast<Thread*>(thread);
os_thread = GetOSThreadFromThread(vm_thread);
}
- }
- return os_thread;
- }
-
- // The currently executing thread. If there is no currently executing thread,
- // a new OSThread is created and returned.
- static OSThread* Current() {
- OSThread* os_thread = TryCurrent();
- if (os_thread == NULL) {
+ } else {
os_thread = CreateAndSetUnknownThread();
}
return os_thread;
« no previous file with comments | « runtime/vm/os_macos.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698