File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -693,6 +693,7 @@ thread_worker(void *ud) {
693693 service_send_signal (P , id );
694694 }
695695 } else if (mainthread_current (& w -> task -> mt , id )) {
696+ service_status_set (P , id , SERVICE_STATUS_MAINTHREAD );
696697 mainthread_trigger (& w -> task -> mt );
697698 } else {
698699 service_status_set (P , id , SERVICE_STATUS_DONE );
@@ -1159,6 +1160,7 @@ lmainthread_wait(lua_State *L) {
11591160 service_id id = mt -> srv ;
11601161
11611162 debug_printf (task -> logger , "service %x run in mainthread" , id .id );
1163+ assert (service_status_get (P , id ) == SERVICE_STATUS_MAINTHREAD );
11621164 if (service_resume (P , id )) {
11631165 // dead
11641166 debug_printf (task -> logger , "service %x is dead in mainthread" , id .id );
Original file line number Diff line number Diff line change 1515#define SERVICE_STATUS_RUNNING 3
1616#define SERVICE_STATUS_DONE 4
1717#define SERVICE_STATUS_DEAD 5
18+ #define SERVICE_STATUS_MAINTHREAD 6
1819
1920struct service_pool ;
2021struct ltask_config ;
You can’t perform that action at this time.
0 commit comments