| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 instance_->Start(); | 1001 instance_->Start(); |
| 1002 } else { | 1002 } else { |
| 1003 ASSERT(instance_->interval_ == sampler->interval()); | 1003 ASSERT(instance_->interval_ == sampler->interval()); |
| 1004 } | 1004 } |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 static void RemoveActiveSampler(Sampler* sampler) { | 1007 static void RemoveActiveSampler(Sampler* sampler) { |
| 1008 ScopedLock lock(mutex_); | 1008 ScopedLock lock(mutex_); |
| 1009 SamplerRegistry::RemoveActiveSampler(sampler); | 1009 SamplerRegistry::RemoveActiveSampler(sampler); |
| 1010 if (SamplerRegistry::GetState() == SamplerRegistry::HAS_NO_SAMPLERS) { | 1010 if (SamplerRegistry::GetState() == SamplerRegistry::HAS_NO_SAMPLERS) { |
| 1011 RuntimeProfiler::WakeUpRuntimeProfilerThreadBeforeShutdown(); | 1011 RuntimeProfiler::StopRuntimeProfilerThreadBeforeShutdown(instance_); |
| 1012 instance_->Join(); | |
| 1013 delete instance_; | 1012 delete instance_; |
| 1014 instance_ = NULL; | 1013 instance_ = NULL; |
| 1015 RestoreSignalHandler(); | 1014 RestoreSignalHandler(); |
| 1016 } | 1015 } |
| 1017 } | 1016 } |
| 1018 | 1017 |
| 1019 // Implement Thread::Run(). | 1018 // Implement Thread::Run(). |
| 1020 virtual void Run() { | 1019 virtual void Run() { |
| 1021 SamplerRegistry::State state; | 1020 SamplerRegistry::State state; |
| 1022 while ((state = SamplerRegistry::GetState()) != | 1021 while ((state = SamplerRegistry::GetState()) != |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 | 1144 |
| 1146 void Sampler::Stop() { | 1145 void Sampler::Stop() { |
| 1147 ASSERT(IsActive()); | 1146 ASSERT(IsActive()); |
| 1148 SignalSender::RemoveActiveSampler(this); | 1147 SignalSender::RemoveActiveSampler(this); |
| 1149 SetActive(false); | 1148 SetActive(false); |
| 1150 } | 1149 } |
| 1151 | 1150 |
| 1152 #endif // ENABLE_LOGGING_AND_PROFILING | 1151 #endif // ENABLE_LOGGING_AND_PROFILING |
| 1153 | 1152 |
| 1154 } } // namespace v8::internal | 1153 } } // namespace v8::internal |
| OLD | NEW |