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

Unified Diff: src/platform-win32.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-solaris.cc ('k') | test/cctest/cctest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-win32.cc
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index 31b65c1b051171f835f9260af855f3a042b22b31..59455273ec1424bec0691376915907c687afab1e 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -1503,17 +1503,19 @@ class Thread::PlatformData : public Malloced {
// Initialize a Win32 thread object. The thread has an invalid thread
// handle until it is started.
-Thread::Thread(Isolate* isolate)
+Thread::Thread(Isolate* isolate, const Options& options)
: ThreadHandle(ThreadHandle::INVALID),
- isolate_(isolate) {
+ isolate_(isolate),
+ stack_size_(options.stack_size) {
data_ = new PlatformData(kNoThread);
- set_name("v8:<unknown>");
+ set_name(options.name);
}
Thread::Thread(Isolate* isolate, const char* name)
: ThreadHandle(ThreadHandle::INVALID),
- isolate_(isolate) {
+ isolate_(isolate),
+ stack_size_(0) {
data_ = new PlatformData(kNoThread);
set_name(name);
}
@@ -1538,7 +1540,7 @@ Thread::~Thread() {
void Thread::Start() {
data_->thread_ = reinterpret_cast<HANDLE>(
_beginthreadex(NULL,
- 0,
+ static_cast<unsigned>(stack_size_),
ThreadEntry,
this,
0,
@@ -1884,7 +1886,9 @@ class Sampler::PlatformData : public Malloced {
class SamplerThread : public Thread {
public:
- explicit SamplerThread(int interval) : Thread(NULL), interval_(interval) {}
+ explicit SamplerThread(int interval)
+ : Thread(NULL, "SamplerThread"),
+ interval_(interval) {}
static void AddActiveSampler(Sampler* sampler) {
ScopedLock lock(mutex_);
« no previous file with comments | « src/platform-solaris.cc ('k') | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698