Can not make graceful exit (C-API) program
Posted: 14 Sep 2018 20:24
Hello
I am using z-way libzway API quite successfully in my C application it
seems to be quite robust as is.
However the exit - I cannot make it cleanly.
The app (service) is terminated by a signal SIGINT, SIGHUP or SIGTERM
launcing ShutdownHandler
The ShutdownHandler calls for zway_stop(zway) & zway_terminate(&zway)
but either one is re-calling the ShutdownHandler again and this leads into
endless loop so the service never stops.
I do have several zdata_add_callback_ex() "threads"in the program but trying to cancel/free them
(before zway_stop() in ShutdownHandler) with zdata_remove_callback_ex() does
return something else than 'NoError'
I do have to go throug ShutdownHandler as the other parts of the software needs cleaning also.
I am using z-way libzway API quite successfully in my C application it
seems to be quite robust as is.
However the exit - I cannot make it cleanly.
The app (service) is terminated by a signal SIGINT, SIGHUP or SIGTERM
launcing ShutdownHandler
The ShutdownHandler calls for zway_stop(zway) & zway_terminate(&zway)
but either one is re-calling the ShutdownHandler again and this leads into
endless loop so the service never stops.
I do have several zdata_add_callback_ex() "threads"in the program but trying to cancel/free them
(before zway_stop() in ShutdownHandler) with zdata_remove_callback_ex() does
return something else than 'NoError'
I do have to go throug ShutdownHandler as the other parts of the software needs cleaning also.