Cocoa Port: Add thread names for this port's own threads too.

This commit is contained in:
rogerman 2021-08-30 20:06:42 -07:00
parent 4f8ba2beb9
commit 03b9481095
6 changed files with 31 additions and 1 deletions

View File

@ -1769,6 +1769,11 @@ CGLPBufferObj OSXOpenGLRendererPBuffer = NULL;
static void* RunFetchThread(void *arg) static void* RunFetchThread(void *arg)
{ {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6)
{
pthread_setname_np("Video Fetch");
}
MacClientSharedObject *sharedData = (MacClientSharedObject *)arg; MacClientSharedObject *sharedData = (MacClientSharedObject *)arg;
[sharedData runFetchLoop]; [sharedData runFetchLoop];

View File

@ -1142,6 +1142,11 @@ volatile bool execute = true;
static void* RunCoreThread(void *arg) static void* RunCoreThread(void *arg)
{ {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6)
{
pthread_setname_np("Emulation Core");
}
CoreThreadParam *param = (CoreThreadParam *)arg; CoreThreadParam *param = (CoreThreadParam *)arg;
CocoaDSCore *cdsCore = (CocoaDSCore *)param->cdsCore; CocoaDSCore *cdsCore = (CocoaDSCore *)param->cdsCore;
ClientExecutionControl *execControl = [cdsCore execControl]; ClientExecutionControl *execControl = [cdsCore execControl];

View File

@ -1,6 +1,6 @@
/* /*
Copyright (C) 2011 Roger Manuel Copyright (C) 2011 Roger Manuel
Copyright (C) 2011-2018 DeSmuME team Copyright (C) 2011-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -1314,6 +1314,11 @@
static void* RunOutputThread(void *arg) static void* RunOutputThread(void *arg)
{ {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6)
{
pthread_setname_np("EmulationOutput");
}
CocoaDSOutput *cdsDisplayOutput = (CocoaDSOutput *)arg; CocoaDSOutput *cdsDisplayOutput = (CocoaDSOutput *)arg;
[cdsDisplayOutput runMessageLoop]; [cdsDisplayOutput runMessageLoop];

View File

@ -1463,6 +1463,11 @@ ClientAVCaptureError FFmpegFileStream::WriteOneFrame(const AVStreamWriteParam &p
static void* RunAVCaptureCloseThread(void *arg) static void* RunAVCaptureCloseThread(void *arg)
{ {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6)
{
pthread_setname_np("AVCapture Close");
}
/* /*
ClientAVCaptureObject *captureObject = (ClientAVCaptureObject *)arg; ClientAVCaptureObject *captureObject = (ClientAVCaptureObject *)arg;
FFmpegFileStream *ffmpegFS = (FFmpegFileStream *)captureObject->GetOutputFileStream(); FFmpegFileStream *ffmpegFS = (FFmpegFileStream *)captureObject->GetOutputFileStream();

View File

@ -131,6 +131,11 @@
static void* RunFileWriteThread(void *arg) static void* RunFileWriteThread(void *arg)
{ {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6)
{
pthread_setname_np("Mac File Write");
}
// Copy the rendering properties from the calling thread. // Copy the rendering properties from the calling thread.
MacCaptureToolParams *inParams = (MacCaptureToolParams *)arg; MacCaptureToolParams *inParams = (MacCaptureToolParams *)arg;
MacCaptureToolParams param; MacCaptureToolParams param;

View File

@ -241,6 +241,11 @@
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{ {
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6)
{
pthread_setname_np("App Main Thread");
}
EmuControllerDelegate *emuControl = (EmuControllerDelegate *)[emuControlController content]; EmuControllerDelegate *emuControl = (EmuControllerDelegate *)[emuControlController content];
// Determine if the app was run for the first time. // Determine if the app was run for the first time.