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

Unified Diff: src/v8threads.h

Issue 14483: Fix issue 142 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years 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 | « no previous file | src/v8threads.cc » ('j') | src/v8threads.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8threads.h
===================================================================
--- src/v8threads.h (revision 981)
+++ src/v8threads.h (working copy)
@@ -87,19 +87,31 @@
};
+// The ContextSwitcher thread is used to schedule regular preemptions to
+// multiple running V8 threads. Generally it is needed to call StartPreemption
Erik Corry 2008/12/17 14:30:07 "it is necessary"
iposva 2008/12/17 17:39:24 Done.
+// if there is more than one thread running. If not a single JavaScript can
Erik Corry 2008/12/17 14:30:07 "If not, a single JavaScript thread can"
iposva 2008/12/17 17:39:24 Done.
+// take full control of V8 and not allow other threads to run.
class ContextSwitcher: public Thread {
public:
- void Run();
+ // Set the preemption interval for the ContextSwitcher thread.
static void StartPreemption(int every_n_ms);
+
+ // Stop sending preemption requests to threads.
static void StopPreemption();
+
+ // Preempted thread needs to calls back to the ContextSwitcher to acknowlege
Erik Corry 2008/12/17 14:30:07 "to call back"
iposva 2008/12/17 17:39:24 Done.
+ // the handling of a preemption request.
static void PreemptionReceived();
+
private:
explicit ContextSwitcher(int every_n_ms);
- void WaitForPreemption();
- void Stop();
- Semaphore* preemption_semaphore_;
+
+ void Run();
+
bool keep_going_;
int sleep_ms_;
+
+ static ContextSwitcher* singleton_;
};
} } // namespace v8::internal
« no previous file with comments | « no previous file | src/v8threads.cc » ('j') | src/v8threads.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698