| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4707 private: | 4707 private: |
| 4708 int num_threads_; | 4708 int num_threads_; |
| 4709 int num_blocked_; | 4709 int num_blocked_; |
| 4710 v8::internal::Mutex* lock_; | 4710 v8::internal::Mutex* lock_; |
| 4711 v8::internal::Semaphore* sem_; | 4711 v8::internal::Semaphore* sem_; |
| 4712 bool invalid_; | 4712 bool invalid_; |
| 4713 }; | 4713 }; |
| 4714 | 4714 |
| 4715 ThreadBarrier::ThreadBarrier(int num_threads) | 4715 ThreadBarrier::ThreadBarrier(int num_threads) |
| 4716 : num_threads_(num_threads), num_blocked_(0) { | 4716 : num_threads_(num_threads), num_blocked_(0) { |
| 4717 lock_ = new v8::internal::Mutex; | 4717 lock_ = OS::CreateMutex(); |
| 4718 sem_ = OS::CreateSemaphore(0); | 4718 sem_ = OS::CreateSemaphore(0); |
| 4719 invalid_ = false; // A barrier may only be used once. Then it is invalid. | 4719 invalid_ = false; // A barrier may only be used once. Then it is invalid. |
| 4720 } | 4720 } |
| 4721 | 4721 |
| 4722 | 4722 |
| 4723 // Do not call, due to race condition with Wait(). | 4723 // Do not call, due to race condition with Wait(). |
| 4724 // Could be resolved with Pthread condition variables. | 4724 // Could be resolved with Pthread condition variables. |
| 4725 ThreadBarrier::~ThreadBarrier() { | 4725 ThreadBarrier::~ThreadBarrier() { |
| 4726 lock_->Lock(); | 4726 lock_->Lock(); |
| 4727 delete lock_; | 4727 delete lock_; |
| (...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7597 TEST(LiveEditDisabled) { | 7597 TEST(LiveEditDisabled) { |
| 7598 v8::internal::FLAG_allow_natives_syntax = true; | 7598 v8::internal::FLAG_allow_natives_syntax = true; |
| 7599 LocalContext env; | 7599 LocalContext env; |
| 7600 v8::HandleScope scope(env->GetIsolate()); | 7600 v8::HandleScope scope(env->GetIsolate()); |
| 7601 v8::Debug::SetLiveEditEnabled(false); | 7601 v8::Debug::SetLiveEditEnabled(false); |
| 7602 CompileRun("%LiveEditCompareStrings('', '')"); | 7602 CompileRun("%LiveEditCompareStrings('', '')"); |
| 7603 } | 7603 } |
| 7604 | 7604 |
| 7605 | 7605 |
| 7606 #endif // ENABLE_DEBUGGER_SUPPORT | 7606 #endif // ENABLE_DEBUGGER_SUPPORT |
| OLD | NEW |