diff --git a/desmume/src/frontend/cocoa/cocoa_GPU.mm b/desmume/src/frontend/cocoa/cocoa_GPU.mm index 5bb5bf091..e9294df27 100644 --- a/desmume/src/frontend/cocoa/cocoa_GPU.mm +++ b/desmume/src/frontend/cocoa/cocoa_GPU.mm @@ -1769,6 +1769,11 @@ CGLPBufferObj OSXOpenGLRendererPBuffer = NULL; static void* RunFetchThread(void *arg) { + if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) + { + pthread_setname_np("Video Fetch"); + } + MacClientSharedObject *sharedData = (MacClientSharedObject *)arg; [sharedData runFetchLoop]; diff --git a/desmume/src/frontend/cocoa/cocoa_core.mm b/desmume/src/frontend/cocoa/cocoa_core.mm index 713d9de43..8522f5a45 100644 --- a/desmume/src/frontend/cocoa/cocoa_core.mm +++ b/desmume/src/frontend/cocoa/cocoa_core.mm @@ -1142,6 +1142,11 @@ volatile bool execute = true; static void* RunCoreThread(void *arg) { + if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) + { + pthread_setname_np("Emulation Core"); + } + CoreThreadParam *param = (CoreThreadParam *)arg; CocoaDSCore *cdsCore = (CocoaDSCore *)param->cdsCore; ClientExecutionControl *execControl = [cdsCore execControl]; diff --git a/desmume/src/frontend/cocoa/cocoa_output.mm b/desmume/src/frontend/cocoa/cocoa_output.mm index 415b33dac..e90ef8bfd 100644 --- a/desmume/src/frontend/cocoa/cocoa_output.mm +++ b/desmume/src/frontend/cocoa/cocoa_output.mm @@ -1,6 +1,6 @@ /* 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 it under the terms of the GNU General Public License as published by @@ -1314,6 +1314,11 @@ static void* RunOutputThread(void *arg) { + if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) + { + pthread_setname_np("EmulationOutput"); + } + CocoaDSOutput *cdsDisplayOutput = (CocoaDSOutput *)arg; [cdsDisplayOutput runMessageLoop]; diff --git a/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm b/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm index 01c070b10..7a9890010 100644 --- a/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm +++ b/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm @@ -1463,6 +1463,11 @@ ClientAVCaptureError FFmpegFileStream::WriteOneFrame(const AVStreamWriteParam &p static void* RunAVCaptureCloseThread(void *arg) { + if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) + { + pthread_setname_np("AVCapture Close"); + } + /* ClientAVCaptureObject *captureObject = (ClientAVCaptureObject *)arg; FFmpegFileStream *ffmpegFS = (FFmpegFileStream *)captureObject->GetOutputFileStream(); diff --git a/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm b/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm index 5bd34b76d..20b5a4bc1 100644 --- a/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm +++ b/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm @@ -131,6 +131,11 @@ static void* RunFileWriteThread(void *arg) { + if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) + { + pthread_setname_np("Mac File Write"); + } + // Copy the rendering properties from the calling thread. MacCaptureToolParams *inParams = (MacCaptureToolParams *)arg; MacCaptureToolParams param; diff --git a/desmume/src/frontend/cocoa/userinterface/appDelegate.mm b/desmume/src/frontend/cocoa/userinterface/appDelegate.mm index 03b25059f..6b18041ff 100644 --- a/desmume/src/frontend/cocoa/userinterface/appDelegate.mm +++ b/desmume/src/frontend/cocoa/userinterface/appDelegate.mm @@ -241,6 +241,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) + { + pthread_setname_np("App Main Thread"); + } + EmuControllerDelegate *emuControl = (EmuControllerDelegate *)[emuControlController content]; // Determine if the app was run for the first time.