diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-08-11 23:56:24 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2019-08-12 07:28:24 +0200 |
commit | 3d06d35bf644a006c2de1c871b30e9c18888c8ec (patch) | |
tree | bc03c5652ed9d31e6c841e5b7e3f64479c1c4d1c | |
parent | 3b75f98700c01266c1d3477767114e41325024c9 (diff) | |
download | rockbox-3d06d35.tar.gz rockbox-3d06d35.zip |
lua rock events crash on error in main state
on errors thread stack overflows
yielding before thread_exit() is a bad idea apparently
Change-Id: Iac45d4321fac496738384fdbbeb480356ef2a1bb
-rw-r--r-- | apps/plugins/lua/rocklib_events.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/plugins/lua/rocklib_events.c b/apps/plugins/lua/rocklib_events.c index 270c4ab393..09f1c2fd8a 100644 --- a/apps/plugins/lua/rocklib_events.c +++ b/apps/plugins/lua/rocklib_events.c @@ -72,6 +72,7 @@ #define EVENT_METATABLE "event metatable" #define EVENT_THREAD LUA_ROCKEVENTSNAME ".thread" +#define EV_STACKSZ DEFAULT_STACK_SIZE #define LUA_SUCCESS 0 #define EV_TIMER_FREQ (TIMER_FREQ / HZ) @@ -323,7 +324,7 @@ event_error: /* thread is exiting -- clean up */ rb->timer_unregister(); - rb->yield(); + //rb->yield(); rb->thread_exit(); return; @@ -360,7 +361,7 @@ static void create_event_thread_ref(struct event_data *ev_data) lua_createtable(L, 2, 0); - ev_data->event_stack = (long *) lua_newuserdata (L, DEFAULT_STACK_SIZE); + ev_data->event_stack = (long *) lua_newuserdata (L, EV_STACKSZ); /* attach EVENT_METATABLE to ud so we get notified on garbage collection */ luaL_getmetatable (L, EVENT_METATABLE); @@ -412,7 +413,7 @@ static void init_event_thread(bool init, struct event_data *ev_data) ev_data->thread_id = rb->create_thread(&event_thread, ev_data->event_stack, - DEFAULT_STACK_SIZE, + EV_STACKSZ, 0, EVENT_THREAD IF_PRIO(, PRIORITY_SYSTEM) |