mirror of
https://github.com/libretro/RetroArch
synced 2025-02-04 03:40:03 +00:00
(iOS Thread) Use pthread, rather than Grand Central Dispatch, to create the emulator thread
This commit is contained in:
parent
67ced23555
commit
ca4921d6c0
@ -76,7 +76,7 @@ static void ios_free_main_wrap(struct rarch_main_wrap* wrap)
|
||||
free(wrap);
|
||||
}
|
||||
|
||||
void rarch_main_ios(void* args)
|
||||
void* rarch_main_ios(void* args)
|
||||
{
|
||||
struct rarch_main_wrap* argdata = (struct rarch_main_wrap*)args;
|
||||
int init_ret = rarch_main_init_wrap(argdata);
|
||||
@ -85,7 +85,7 @@ void rarch_main_ios(void* args)
|
||||
if (init_ret)
|
||||
{
|
||||
dispatch_async_f(dispatch_get_main_queue(), (void*)1, ios_rarch_exited);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_RGUI
|
||||
@ -157,4 +157,5 @@ void rarch_main_ios(void* args)
|
||||
rarch_main_clear_state();
|
||||
|
||||
dispatch_async_f(dispatch_get_main_queue(), 0, ios_rarch_exited);
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <dispatch/dispatch.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "rarch_wrapper.h"
|
||||
#include "general.h"
|
||||
@ -29,7 +29,7 @@
|
||||
#define kDOCSFOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
|
||||
|
||||
// From frontend/frontend_ios.c
|
||||
extern void rarch_main_ios(void* args);
|
||||
extern void* rarch_main_ios(void* args);
|
||||
extern void ios_frontend_post_event(void (*fn)(void*), void* userdata);
|
||||
|
||||
static void event_game_reset(void* userdata)
|
||||
@ -67,6 +67,8 @@ static void event_reload_config(void* userdata)
|
||||
{
|
||||
UIWindow* _window;
|
||||
|
||||
pthread_t _retroThread;
|
||||
|
||||
bool _isGameTop;
|
||||
bool _isPaused;
|
||||
bool _isRunning;
|
||||
@ -157,9 +159,12 @@ static void event_reload_config(void* userdata)
|
||||
load_data->state_path = strdup(sd);
|
||||
load_data->verbose = false;
|
||||
load_data->config_path = strdup(cf);
|
||||
dispatch_async_f(dispatch_get_global_queue(0, 0), load_data, rarch_main_ios);
|
||||
_isRunning = true;
|
||||
|
||||
if (pthread_create(&_retroThread, 0, rarch_main_ios, load_data))
|
||||
{
|
||||
[self rarchExited:NO];
|
||||
}
|
||||
pthread_detach(_retroThread);
|
||||
|
||||
// Read load time settings
|
||||
// TODO: Do this better
|
||||
config_file_t* conf = config_file_new([self.moduleInfo.configPath UTF8String]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user