Fix build breakage.
Change-Id: I7fe647db9e04653af204e41a10702b06626576bb
diff --git a/src/thread.cc b/src/thread.cc
index 7c76f4c..5b4b073 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -62,6 +62,7 @@
}
Thread* new_thread = new Thread;
+ new_thread->InitCpu();
new_thread->stack_limit_ = static_cast<byte*>(stack_limit);
new_thread->stack_base_ = new_thread->stack_limit_ + length;
@@ -79,14 +80,12 @@
result = pthread_attr_destroy(&attr);
CHECK_EQ(result, 0);
- InitCpu();
-
return new_thread;
}
Thread* Thread::Attach() {
Thread* thread = new Thread;
-
+ thread->InitCpu();
thread->stack_limit_ = reinterpret_cast<byte*>(-1); // TODO: getrlimit
uintptr_t addr = reinterpret_cast<uintptr_t>(&thread); // TODO: ask pthreads
uintptr_t stack_base = RoundUp(addr, 4096);
@@ -102,8 +101,6 @@
PLOG(FATAL) << "pthread_setspecific failed";
}
- InitCpu();
-
return thread;
}