Get rid of APP_CMD_DEAD hack

This commit is contained in:
twinaphex 2015-05-02 02:55:51 +02:00
parent 681f88948b
commit bc0a933114
3 changed files with 2 additions and 18 deletions

View File

@ -335,13 +335,9 @@ static void android_app_set_activity_state(struct android_app *android_app, int8
{ {
pthread_mutex_lock(&android_app->mutex); pthread_mutex_lock(&android_app->mutex);
android_app_write_cmd(android_app, cmd); android_app_write_cmd(android_app, cmd);
while (android_app->activityState != cmd while (android_app->activityState != cmd)
&& android_app->activityState != APP_CMD_DEAD)
pthread_cond_wait(&android_app->cond, &android_app->mutex); pthread_cond_wait(&android_app->cond, &android_app->mutex);
pthread_mutex_unlock(&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) static void android_app_free(struct android_app* android_app)

View File

@ -327,9 +327,6 @@ enum
* and waiting for the app thread to clean up and exit before proceeding. * and waiting for the app thread to clean up and exit before proceeding.
*/ */
APP_CMD_DESTROY, 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); void android_app_write_cmd(struct android_app *android_app, int8_t cmd);

View File

@ -434,14 +434,6 @@ static void frontend_android_deinit(void *data)
return; return;
RARCH_LOG("Deinitializing RetroArch ...\n"); 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); bool android_run_events(void *data);
@ -621,7 +613,6 @@ static void frontend_android_init(void *data)
if (!android_run_events(android_app)) if (!android_run_events(android_app))
{ {
frontend_android_deinit(android_app); frontend_android_deinit(android_app);
frontend_android_shutdown(android_app);
return; return;
} }
} }
@ -691,7 +682,7 @@ const frontend_ctx_driver_t frontend_ctx_android = {
NULL, /* process_args */ NULL, /* process_args */
NULL, /* exec */ NULL, /* exec */
NULL, /* set_fork */ NULL, /* set_fork */
frontend_android_shutdown, NULL, /* shutdown */
frontend_android_get_name, frontend_android_get_name,
frontend_android_get_os, frontend_android_get_os,
frontend_android_get_rating, frontend_android_get_rating,