Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

appbase: rework blocking (queuing) exit signals during shutdown #6857

Merged
merged 1 commit into from
Mar 1, 2019

Commits on Mar 1, 2019

  1. appbase: rework blocking (queuing) exit signals during shutdown

    The previous fix for blocking signals during shutdown seems to have problems on older platforms/compilers/stdlibs like gcc6. To be completely frank I couldn’t quite pinpoint the exact cause but I highly suspect it is something to do with the application instance being static and thus the ordering of static destructors being unfavorable.
    
    I’ve changed the implementation such that during startup a separate thread is run that catches the signals but after startup that thread is retired and signal handling is then handled on the main io_service. Signals end up being blocked (queued) until destruction of application’s io_service because the async_wait() will hold a shared_ptr to the signal_set. The implementation ends up being a bit long winded but means there are no shenanigans trying to clean up threads after main() has fully returned.
    spoonincode committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    cc61de0 View commit details
    Browse the repository at this point in the history