Commit 0ec3ba8f authored by vitalyr@chromium.org's avatar vitalyr@chromium.org

Tighten handling of pthread_create errors on Linux.

The return value of pthread_create is now checked to be 0.
Tests on MIPS boards had some silent and hard to find timeouts and errors related to this.
This ensures a proper error message and shutdown if a thread could not be started.

BUG=
TEST=

Review URL: http://codereview.chromium.org/8497041
Patch from Gergely Kis <gergely@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9945 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8a074ba1
......@@ -768,7 +768,8 @@ void Thread::Start() {
pthread_attr_setstacksize(&attr, static_cast<size_t>(stack_size_));
attr_ptr = &attr;
}
pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this);
int result = pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this);
CHECK_EQ(0, result);
ASSERT(data_->thread_ != kNoThread);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment