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

Unified Diff: src/platform-solaris.cc

Issue 6711068: Use v8::internal threading support in samples/shell.cc. (Closed)
Patch Set: Created 9 years, 9 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 | « src/platform-openbsd.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-solaris.cc
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
index 6e66512841b8526b0d5c21e90741a70bdb0f2c88..da278f3439e5c425daaea36a5f0d8acbc86afdae 100644
--- a/src/platform-solaris.cc
+++ b/src/platform-solaris.cc
@@ -415,16 +415,18 @@ bool ThreadHandle::IsValid() const {
}
-Thread::Thread(Isolate* isolate)
+Thread::Thread(Isolate* isolate, const Options& options)
: ThreadHandle(ThreadHandle::INVALID),
- isolate_(isolate) {
- set_name("v8:<unknown>");
+ isolate_(isolate),
+ stack_size_(options.stack_size) {
+ set_name(options.name);
}
Thread::Thread(Isolate* isolate, const char* name)
: ThreadHandle(ThreadHandle::INVALID),
- isolate_(isolate) {
+ isolate_(isolate),
+ stack_size_(0) {
set_name(name);
}
@@ -453,6 +455,13 @@ void Thread::set_name(const char* name) {
void Thread::Start() {
+ pthread_attr_t* attr_ptr = NULL;
+ pthread_attr_t attr;
+ if (stack_size_ > 0) {
+ pthread_attr_init(&attr);
+ pthread_attr_setstacksize(&attr, static_cast<size_t>(stack_size_));
+ attr_ptr = &attr;
+ }
pthread_create(&thread_handle_data()->thread_, NULL, ThreadEntry, this);
ASSERT(IsValid());
}
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698