Fix asserts in StartPreemption and StopPreemption.
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 6 Jun 2011 08:45:42 +0000 (08:45 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 6 Jun 2011 08:45:42 +0000 (08:45 +0000)
Review URL: http://codereview.chromium.org/7054070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/v8threads.cc

index 26169b5..c1e5913 100644 (file)
@@ -411,7 +411,7 @@ ContextSwitcher::ContextSwitcher(Isolate* isolate, int every_n_ms)
 // ContextSwitcher thread if needed.
 void ContextSwitcher::StartPreemption(int every_n_ms) {
   Isolate* isolate = Isolate::Current();
-  ASSERT(Locker::IsLocked());
+  ASSERT(Locker::IsLocked(reinterpret_cast<v8::Isolate*>(isolate)));
   if (isolate->context_switcher() == NULL) {
     // If the ContextSwitcher thread is not running at the moment start it now.
     isolate->set_context_switcher(new ContextSwitcher(isolate, every_n_ms));
@@ -428,7 +428,7 @@ void ContextSwitcher::StartPreemption(int every_n_ms) {
 // must cooperatively schedule amongst them from this point on.
 void ContextSwitcher::StopPreemption() {
   Isolate* isolate = Isolate::Current();
-  ASSERT(Locker::IsLocked());
+  ASSERT(Locker::IsLocked(reinterpret_cast<v8::Isolate*>(isolate)));
   if (isolate->context_switcher() != NULL) {
     // The ContextSwitcher thread is running. We need to stop it and release
     // its resources.