mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
Bug 1163135 - Make it safer to start the profiler via signal; r=snorp
This commit is contained in:
parent
161a4c26ba
commit
dc596951dd
@ -646,11 +646,7 @@ static void ReadProfilerVars(const char* fileName, const char** features,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void StartSignalHandler(int signal, siginfo_t* info, void* context) {
|
||||
// XXX: Everything we do here is NOT async signal safe. We risk nasty things
|
||||
// like deadlocks but we typically only do this once so it tends to be ok.
|
||||
// See bug 909403
|
||||
static void DoStartTask() {
|
||||
uint32_t featureCount = 0;
|
||||
uint32_t threadCount = 0;
|
||||
|
||||
@ -674,6 +670,20 @@ static void StartSignalHandler(int signal, siginfo_t* info, void* context) {
|
||||
freeArray(features, featureCount);
|
||||
}
|
||||
|
||||
static void StartSignalHandler(int signal, siginfo_t* info, void* context) {
|
||||
class StartTask : public nsRunnable {
|
||||
public:
|
||||
NS_IMETHOD Run() {
|
||||
DoStartTask();
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
// XXX: technically NS_DispatchToMainThread is NOT async signal safe. We risk
|
||||
// nasty things like deadlocks, but the probability is very low and we
|
||||
// typically only do this once so it tends to be ok. See bug 909403.
|
||||
NS_DispatchToMainThread(new StartTask());
|
||||
}
|
||||
|
||||
void OS::Startup()
|
||||
{
|
||||
LOG("Registering start signal");
|
||||
|
Loading…
x
Reference in New Issue
Block a user