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

Side by Side Diff: test/cctest/test-lockers.cc

Issue 7129002: Fix bug 1433: clear the global thread table when an isolate is disposed. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007-2011 the V8 project authors. All rights reserved. 1 // Copyright 2007-2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 v8::Locker locker_; 600 v8::Locker locker_;
601 v8::HandleScope handle_scope; 601 v8::HandleScope handle_scope;
602 context = v8::Context::New(); 602 context = v8::Context::New();
603 } 603 }
604 i::List<JoinableThread*> threads(kNThreads); 604 i::List<JoinableThread*> threads(kNThreads);
605 for (int i = 0; i < kNThreads; i++) { 605 for (int i = 0; i < kNThreads; i++) {
606 threads.Add(new LockUnlockLockDefaultIsolateThread(context)); 606 threads.Add(new LockUnlockLockDefaultIsolateThread(context));
607 } 607 }
608 StartJoinAndDeleteThreads(threads); 608 StartJoinAndDeleteThreads(threads);
609 } 609 }
610
611
612 TEST(Regress1433) {
613 for (int i = 0; i < 10; i++) {
614 v8::Isolate* isolate = v8::Isolate::New();
615 {
616 v8::Locker l(isolate);
Mads Ager (chromium) 2011/06/07 18:28:18 l -> lock?
Vitaly Repeshko 2011/06/07 18:32:53 Done.
617 v8::Isolate::Scope iscope(isolate);
Mads Ager (chromium) 2011/06/07 18:28:18 iscope -> isolate_scope to match the other naming
Vitaly Repeshko 2011/06/07 18:32:53 Done.
618 v8::HandleScope handle_scope;
619 v8::Persistent<Context> context = v8::Context::New();
620 v8::Context::Scope context_scope(context);
621 v8::Handle<String> source = v8::String::New("1+1");
622 v8::Handle<Script> script = v8::Script::Compile(source);
623 v8::Handle<Value> result = script->Run();
624 v8::String::AsciiValue ascii(result);
625 context.Dispose();
626 }
627 isolate->Dispose();
628 }
629 }
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698