OLD | NEW |
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 } | 554 } |
555 i::List<JoinableThread*> threads(kNThreads); | 555 i::List<JoinableThread*> threads(kNThreads); |
556 for (int i = 0; i < kNThreads; i++) { | 556 for (int i = 0; i < kNThreads; i++) { |
557 threads.Add(new LockUnlockLockThread(isolate, context)); | 557 threads.Add(new LockUnlockLockThread(isolate, context)); |
558 } | 558 } |
559 StartJoinAndDeleteThreads(threads); | 559 StartJoinAndDeleteThreads(threads); |
560 } | 560 } |
561 | 561 |
562 class LockUnlockLockDefaultIsolateThread : public JoinableThread { | 562 class LockUnlockLockDefaultIsolateThread : public JoinableThread { |
563 public: | 563 public: |
564 LockUnlockLockDefaultIsolateThread(v8::Handle<v8::Context> context) | 564 explicit LockUnlockLockDefaultIsolateThread(v8::Handle<v8::Context> context) |
565 : JoinableThread("LockUnlockLockDefaultIsolateThread"), | 565 : JoinableThread("LockUnlockLockDefaultIsolateThread"), |
566 context_(context) { | 566 context_(context) { |
567 } | 567 } |
568 | 568 |
569 virtual void Run() { | 569 virtual void Run() { |
570 v8::Locker lock1; | 570 v8::Locker lock1; |
571 { | 571 { |
572 v8::HandleScope handle_scope; | 572 v8::HandleScope handle_scope; |
573 v8::Context::Scope context_scope(context_); | 573 v8::Context::Scope context_scope(context_); |
574 CalcFibAndCheck(); | 574 CalcFibAndCheck(); |
(...skipping 21 matching lines...) Expand all Loading... |
596 v8::Locker locker_; | 596 v8::Locker locker_; |
597 v8::HandleScope handle_scope; | 597 v8::HandleScope handle_scope; |
598 context = v8::Context::New(); | 598 context = v8::Context::New(); |
599 } | 599 } |
600 i::List<JoinableThread*> threads(kNThreads); | 600 i::List<JoinableThread*> threads(kNThreads); |
601 for (int i = 0; i < kNThreads; i++) { | 601 for (int i = 0; i < kNThreads; i++) { |
602 threads.Add(new LockUnlockLockDefaultIsolateThread(context)); | 602 threads.Add(new LockUnlockLockDefaultIsolateThread(context)); |
603 } | 603 } |
604 StartJoinAndDeleteThreads(threads); | 604 StartJoinAndDeleteThreads(threads); |
605 } | 605 } |
OLD | NEW |