mirror of https://github.com/mgba-emu/mgba.git
All: Threads are now named
This commit is contained in:
parent
910ff621b3
commit
4469a9a05f
1
CHANGES
1
CHANGES
|
@ -69,6 +69,7 @@ Misc:
|
||||||
- GBA Thread: Split GBASync into a separate file
|
- GBA Thread: Split GBASync into a separate file
|
||||||
- SDL: Properly check for initialization
|
- SDL: Properly check for initialization
|
||||||
- SDL: Clean up initialization functions
|
- SDL: Clean up initialization functions
|
||||||
|
- All: Threads are now named
|
||||||
|
|
||||||
0.2.1: (2015-05-13)
|
0.2.1: (2015-05-13)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -110,6 +110,8 @@ static THREAD_ENTRY _GBAThreadRun(void* context) {
|
||||||
struct GBARRContext* movie = 0;
|
struct GBARRContext* movie = 0;
|
||||||
int numComponents = GBA_COMPONENT_MAX;
|
int numComponents = GBA_COMPONENT_MAX;
|
||||||
|
|
||||||
|
ThreadSetName("CPU Thread");
|
||||||
|
|
||||||
#if !defined(_WIN32) && defined(USE_PTHREADS)
|
#if !defined(_WIN32) && defined(USE_PTHREADS)
|
||||||
sigset_t signals;
|
sigset_t signals;
|
||||||
sigemptyset(&signals);
|
sigemptyset(&signals);
|
||||||
|
|
|
@ -38,6 +38,7 @@ void DisplayGL::startDrawing(GBAThread* thread) {
|
||||||
m_painter->resize(size());
|
m_painter->resize(size());
|
||||||
m_gl->move(0, 0);
|
m_gl->move(0, 0);
|
||||||
m_drawThread = new QThread(this);
|
m_drawThread = new QThread(this);
|
||||||
|
m_drawThread->setObjectName("Painter Thread");
|
||||||
m_gl->context()->doneCurrent();
|
m_gl->context()->doneCurrent();
|
||||||
m_gl->context()->moveToThread(m_drawThread);
|
m_gl->context()->moveToThread(m_drawThread);
|
||||||
m_painter->moveToThread(m_drawThread);
|
m_painter->moveToThread(m_drawThread);
|
||||||
|
|
|
@ -94,7 +94,6 @@ private:
|
||||||
QPainter m_painter;
|
QPainter m_painter;
|
||||||
QStaticText m_message;
|
QStaticText m_message;
|
||||||
QGLWidget* m_gl;
|
QGLWidget* m_gl;
|
||||||
QThread* m_thread;
|
|
||||||
bool m_active;
|
bool m_active;
|
||||||
QTimer m_messageTimer;
|
QTimer m_messageTimer;
|
||||||
GBAThread* m_context;
|
GBAThread* m_context;
|
||||||
|
|
|
@ -157,6 +157,7 @@ GameController::GameController(QObject* parent)
|
||||||
});
|
});
|
||||||
m_rewindTimer.setInterval(100);
|
m_rewindTimer.setInterval(100);
|
||||||
|
|
||||||
|
m_audioThread->setObjectName("Audio Thread");
|
||||||
m_audioThread->start(QThread::TimeCriticalPriority);
|
m_audioThread->start(QThread::TimeCriticalPriority);
|
||||||
m_audioProcessor->moveToThread(m_audioThread);
|
m_audioProcessor->moveToThread(m_audioThread);
|
||||||
connect(this, SIGNAL(gameStarted(GBAThread*)), m_audioProcessor, SLOT(start()));
|
connect(this, SIGNAL(gameStarted(GBAThread*)), m_audioProcessor, SLOT(start()));
|
||||||
|
|
|
@ -75,6 +75,16 @@ static inline int ThreadJoin(Thread thread) {
|
||||||
return pthread_join(thread, 0);
|
return pthread_join(thread, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int ThreadSetName(const char* name) {
|
||||||
|
#ifdef __APPLE__
|
||||||
|
return pthread_setname_np(name);
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
return pthread_set_name_np(pthread_self(), name);
|
||||||
|
#else
|
||||||
|
return pthread_setname_np(pthread_self(), name);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
#define _WIN32_WINNT 0x0600
|
#define _WIN32_WINNT 0x0600
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -143,6 +153,10 @@ static inline int ThreadJoin(Thread thread) {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int ThreadSetName(const char* name) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#define DISABLE_THREADING
|
#define DISABLE_THREADING
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue