mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 1541282 - Use native call in NS_SetCurrentThreadName() on Android r=froydnj
PR_SetCurrentThreadName() is broken on Android (Bug 1541216). In order to work around this issue, NS_SetCurrentThreadName() will call prctl(PR_SET_NAME, name) until the underlying nspr can be fixed. Differential Revision: https://phabricator.services.mozilla.com/D25891 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2f6cd63d92
commit
1d15aad0e5
@ -28,6 +28,10 @@
|
||||
# include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID)
|
||||
# include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
#ifndef XPCOM_GLUE_AVOID_NSPR
|
||||
@ -483,7 +487,12 @@ bool NS_ProcessNextEvent(nsIThread* aThread, bool aMayWait) {
|
||||
}
|
||||
|
||||
void NS_SetCurrentThreadName(const char* aName) {
|
||||
#if defined(ANDROID)
|
||||
// Workaround for Bug 1541216 - PR_SetCurrentThreadName() Fails to set the thread name on Android.
|
||||
prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(aName));
|
||||
#else
|
||||
PR_SetCurrentThreadName(aName);
|
||||
#endif
|
||||
CrashReporter::SetCurrentThreadName(aName);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user