Revision: 9945
Author: [email protected]
Date: Wed Nov 9 11:02:41 2011
Log: 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 <[email protected]>.
http://code.google.com/p/v8/source/detail?r=9945
Modified:
/branches/bleeding_edge/src/platform-linux.cc
=======================================
--- /branches/bleeding_edge/src/platform-linux.cc Wed Nov 9 03:57:05 2011
+++ /branches/bleeding_edge/src/platform-linux.cc Wed Nov 9 11:02:41 2011
@@ -768,7 +768,8 @@
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);
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev