mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Bug 1355357 (part 1) - Rename profiled_thread_ and profiled_thread() in PlatformData. r=jseward.
--HG-- extra : rebase_source : e223ab428aeeb0e711c31dc47a19d5d1bcc471ed
This commit is contained in:
parent
c2f4575446
commit
e64832b7ec
@ -54,25 +54,25 @@ SleepMicro(int aMicroseconds)
|
||||
class PlatformData
|
||||
{
|
||||
public:
|
||||
explicit PlatformData(int aThreadId) : profiled_thread_(mach_thread_self())
|
||||
explicit PlatformData(int aThreadId) : mProfiledThread(mach_thread_self())
|
||||
{
|
||||
MOZ_COUNT_CTOR(PlatformData);
|
||||
}
|
||||
|
||||
~PlatformData() {
|
||||
// Deallocate Mach port for thread.
|
||||
mach_port_deallocate(mach_task_self(), profiled_thread_);
|
||||
mach_port_deallocate(mach_task_self(), mProfiledThread);
|
||||
|
||||
MOZ_COUNT_DTOR(PlatformData);
|
||||
}
|
||||
|
||||
thread_act_t profiled_thread() { return profiled_thread_; }
|
||||
thread_act_t ProfiledThread() { return mProfiledThread; }
|
||||
|
||||
private:
|
||||
// Note: for profiled_thread_ Mach primitives are used instead of PThread's
|
||||
// Note: for mProfiledThread Mach primitives are used instead of pthread's
|
||||
// because the latter doesn't provide thread manipulation primitives required.
|
||||
// For details, consult "Mac OS X Internals" book, Section 7.3.
|
||||
thread_act_t profiled_thread_;
|
||||
thread_act_t mProfiledThread;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@ -130,7 +130,7 @@ void
|
||||
SamplerThread::SuspendAndSampleAndResumeThread(PS::LockRef aLock,
|
||||
TickSample* aSample)
|
||||
{
|
||||
thread_act_t samplee_thread = aSample->mPlatformData->profiled_thread();
|
||||
thread_act_t samplee_thread = aSample->mPlatformData->ProfiledThread();
|
||||
|
||||
//----------------------------------------------------------------//
|
||||
// Suspend the samplee thread and get its context.
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
// not work in this case. We're using OpenThread because DuplicateHandle
|
||||
// for some reason doesn't work in Chrome's sandbox.
|
||||
explicit PlatformData(int aThreadId)
|
||||
: profiled_thread_(OpenThread(THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME |
|
||||
: mProfiledThread(OpenThread(THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME |
|
||||
THREAD_QUERY_INFORMATION,
|
||||
false,
|
||||
aThreadId))
|
||||
@ -66,23 +66,23 @@ public:
|
||||
|
||||
~PlatformData()
|
||||
{
|
||||
if (profiled_thread_ != nullptr) {
|
||||
CloseHandle(profiled_thread_);
|
||||
profiled_thread_ = nullptr;
|
||||
if (mProfiledThread != nullptr) {
|
||||
CloseHandle(mProfiledThread);
|
||||
mProfiledThread = nullptr;
|
||||
}
|
||||
MOZ_COUNT_DTOR(PlatformData);
|
||||
}
|
||||
|
||||
HANDLE profiled_thread() { return profiled_thread_; }
|
||||
HANDLE ProfiledThread() { return mProfiledThread; }
|
||||
|
||||
private:
|
||||
HANDLE profiled_thread_;
|
||||
HANDLE mProfiledThread;
|
||||
};
|
||||
|
||||
uintptr_t
|
||||
GetThreadHandle(PlatformData* aData)
|
||||
{
|
||||
return (uintptr_t) aData->profiled_thread();
|
||||
return (uintptr_t) aData->ProfiledThread();
|
||||
}
|
||||
|
||||
static const HANDLE kNoThread = INVALID_HANDLE_VALUE;
|
||||
|
Loading…
Reference in New Issue
Block a user