зеркало из https://github.com/mozilla/gecko-dev.git
Bug 698002. Change active_ to Atomic32. r=bgirard
This brings us closer to V8 --HG-- extra : rebase_source : 75685ef885ed1f8abb4ef7a6144d6581a2316941
This commit is contained in:
Родитель
1f1379dbfb
Коммит
31576eb3f6
|
@ -295,7 +295,7 @@ void Sampler::Start() {
|
|||
// Start a thread that sends SIGPROF signal to VM thread.
|
||||
// Sending the signal ourselves instead of relying on itimer provides
|
||||
// much better accuracy.
|
||||
active_ = true;
|
||||
SetActive(true);
|
||||
if (pthread_create(
|
||||
&data_->signal_sender_thread_, NULL, SenderEntry, data_) == 0) {
|
||||
data_->signal_sender_launched_ = true;
|
||||
|
@ -308,7 +308,7 @@ void Sampler::Start() {
|
|||
|
||||
|
||||
void Sampler::Stop() {
|
||||
active_ = false;
|
||||
SetActive(false);
|
||||
|
||||
// Wait for signal sender termination (it will exit after setting
|
||||
// active_ to false).
|
||||
|
|
|
@ -144,10 +144,12 @@ class Sampler {
|
|||
class PlatformData;
|
||||
|
||||
private:
|
||||
void SetActive(bool value) { NoBarrier_Store(&active_, value); }
|
||||
|
||||
const int interval_;
|
||||
const bool profiling_;
|
||||
const bool synchronous_;
|
||||
bool active_;
|
||||
Atomic32 active_;
|
||||
PlatformData* data_; // Platform specific data.
|
||||
};
|
||||
|
||||
|
|
|
@ -51,6 +51,15 @@
|
|||
#warning Please add support for your architecture in chromium_types.h
|
||||
#endif
|
||||
|
||||
typedef int32_t Atomic32;
|
||||
|
||||
#if defined(V8_HOST_ARCH_X64) || defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM)
|
||||
inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
|
||||
*ptr = value;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
const int kMaxInt = 0x7FFFFFFF;
|
||||
const int kMinInt = -kMaxInt - 1;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче