mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 765158 - Remove naming of main thread, conflicts with process name on Linux, r=bsmedberg
This commit is contained in:
parent
3c33725683
commit
cf912de8e4
@ -10,7 +10,8 @@
|
||||
#include "prprf.h"
|
||||
#include "prio.h"
|
||||
#include "prenv.h"
|
||||
#include "plstr.h"
|
||||
#include "plstr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
namespace mozilla { namespace eventtracer {
|
||||
|
||||
@ -54,6 +55,22 @@ public:
|
||||
char * mText2;
|
||||
};
|
||||
|
||||
char * DupCurrentThreadName()
|
||||
{
|
||||
if (NS_IsMainThread())
|
||||
return PL_strdup("Main Thread");
|
||||
|
||||
PRThread * currentThread = PR_GetCurrentThread();
|
||||
const char * name = PR_GetThreadName(currentThread);
|
||||
if (name)
|
||||
return PL_strdup(name);
|
||||
|
||||
char buffer[128];
|
||||
PR_snprintf(buffer, 127, "Nameless %p", currentThread);
|
||||
|
||||
return PL_strdup(buffer);
|
||||
}
|
||||
|
||||
// An array of events, each thread keeps its own private instance
|
||||
class RecordBatch {
|
||||
public:
|
||||
@ -62,7 +79,7 @@ public:
|
||||
, mRecordsTail(mRecordsHead + kBatchSize)
|
||||
, mNextRecord(mRecordsHead)
|
||||
, mNextBatch(nsnull)
|
||||
, mThreadNameCopy(PL_strdup(PR_GetThreadName(PR_GetCurrentThread())))
|
||||
, mThreadNameCopy(DupCurrentThreadName())
|
||||
{
|
||||
MOZ_COUNT_CTOR(RecordBatch);
|
||||
}
|
||||
|
@ -315,8 +315,6 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
||||
{
|
||||
NS_TIME_FUNCTION;
|
||||
|
||||
PR_SetCurrentThreadName("Main Thread");
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// We are not shutting down
|
||||
|
Loading…
x
Reference in New Issue
Block a user