mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Get rid of APP_CMD_DEAD hack
This commit is contained in:
parent
681f88948b
commit
bc0a933114
@ -335,13 +335,9 @@ static void android_app_set_activity_state(struct android_app *android_app, int8
|
||||
{
|
||||
pthread_mutex_lock(&android_app->mutex);
|
||||
android_app_write_cmd(android_app, cmd);
|
||||
while (android_app->activityState != cmd
|
||||
&& android_app->activityState != APP_CMD_DEAD)
|
||||
while (android_app->activityState != cmd)
|
||||
pthread_cond_wait(&android_app->cond, &android_app->mutex);
|
||||
pthread_mutex_unlock(&android_app->mutex);
|
||||
|
||||
if (android_app->activityState == APP_CMD_DEAD)
|
||||
RARCH_LOG("RetroArch native thread is dead.\n");
|
||||
}
|
||||
|
||||
static void android_app_free(struct android_app* android_app)
|
||||
|
@ -327,9 +327,6 @@ enum
|
||||
* and waiting for the app thread to clean up and exit before proceeding.
|
||||
*/
|
||||
APP_CMD_DESTROY,
|
||||
|
||||
// Set by thread when it will no longer reply to commands.
|
||||
APP_CMD_DEAD,
|
||||
};
|
||||
|
||||
void android_app_write_cmd(struct android_app *android_app, int8_t cmd);
|
||||
|
@ -434,14 +434,6 @@ static void frontend_android_deinit(void *data)
|
||||
return;
|
||||
|
||||
RARCH_LOG("Deinitializing RetroArch ...\n");
|
||||
android_app->activityState = APP_CMD_DEAD;
|
||||
}
|
||||
|
||||
static void frontend_android_shutdown(bool unused)
|
||||
{
|
||||
(void)unused;
|
||||
/* Cleaner approaches don't work sadly. */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
bool android_run_events(void *data);
|
||||
@ -621,7 +613,6 @@ static void frontend_android_init(void *data)
|
||||
if (!android_run_events(android_app))
|
||||
{
|
||||
frontend_android_deinit(android_app);
|
||||
frontend_android_shutdown(android_app);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -691,7 +682,7 @@ const frontend_ctx_driver_t frontend_ctx_android = {
|
||||
NULL, /* process_args */
|
||||
NULL, /* exec */
|
||||
NULL, /* set_fork */
|
||||
frontend_android_shutdown,
|
||||
NULL, /* shutdown */
|
||||
frontend_android_get_name,
|
||||
frontend_android_get_os,
|
||||
frontend_android_get_rating,
|
||||
|
Loading…
x
Reference in New Issue
Block a user