Init glib threads

We actually does not use them but there's a plan to do so.
This commit is contained in:
riccardom 2010-01-26 14:38:24 +00:00
parent 823030cbaf
commit 6c996f8993
2 changed files with 7 additions and 3 deletions

View File

@ -1,11 +1,11 @@
SUBDIRS = doc SUBDIRS = doc
include $(top_srcdir)/src/desmume.mk include $(top_srcdir)/src/desmume.mk
AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
bin_PROGRAMS = desmume-cli bin_PROGRAMS = desmume-cli
desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp
desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS)
if HAVE_GDB_STUB if HAVE_GDB_STUB
desmume_cli_LDADD += ../gdbstub/libgdbstub.a desmume_cli_LDADD += ../gdbstub/libgdbstub.a
endif endif

View File

@ -22,7 +22,7 @@
#include <SDL_thread.h> #include <SDL_thread.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <glib.h>
#ifndef VERSION #ifndef VERSION
#define VERSION "Unknown version" #define VERSION "Unknown version"
@ -778,6 +778,10 @@ int main(int argc, char ** argv) {
fw_config.language = my_config.firmware_language; fw_config.language = my_config.firmware_language;
} }
if ( !g_thread_supported()) {
g_thread_init( NULL);
}
#ifdef GDB_STUB #ifdef GDB_STUB
if ( my_config.arm9_gdb_port != 0) { if ( my_config.arm9_gdb_port != 0) {
arm9_gdb_stub = createStub_gdb( my_config.arm9_gdb_port, arm9_gdb_stub = createStub_gdb( my_config.arm9_gdb_port,