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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 } | 703 } |
704 | 704 |
705 | 705 |
706 class SignalSender : public Thread { | 706 class SignalSender : public Thread { |
707 public: | 707 public: |
708 enum SleepInterval { | 708 enum SleepInterval { |
709 HALF_INTERVAL, | 709 HALF_INTERVAL, |
710 FULL_INTERVAL | 710 FULL_INTERVAL |
711 }; | 711 }; |
712 | 712 |
713 static const int kSignalSenderStackSize = 32 * KB; | 713 static const int kSignalSenderStackSize = 64 * KB; |
714 | 714 |
715 explicit SignalSender(int interval) | 715 explicit SignalSender(int interval) |
716 : Thread(Thread::Options("SignalSender", kSignalSenderStackSize)), | 716 : Thread(Thread::Options("SignalSender", kSignalSenderStackSize)), |
717 interval_(interval) {} | 717 interval_(interval) {} |
718 | 718 |
719 static void AddActiveSampler(Sampler* sampler) { | 719 static void AddActiveSampler(Sampler* sampler) { |
720 ScopedLock lock(mutex_); | 720 ScopedLock lock(mutex_); |
721 SamplerRegistry::AddActiveSampler(sampler); | 721 SamplerRegistry::AddActiveSampler(sampler); |
722 if (instance_ == NULL) { | 722 if (instance_ == NULL) { |
723 // Install a signal handler. | 723 // Install a signal handler. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 | 869 |
870 | 870 |
871 void Sampler::Stop() { | 871 void Sampler::Stop() { |
872 ASSERT(IsActive()); | 872 ASSERT(IsActive()); |
873 SignalSender::RemoveActiveSampler(this); | 873 SignalSender::RemoveActiveSampler(this); |
874 SetActive(false); | 874 SetActive(false); |
875 } | 875 } |
876 | 876 |
877 | 877 |
878 } } // namespace v8::internal | 878 } } // namespace v8::internal |
OLD | NEW |