Linking the nvbuf_surface library to a c++ program spawns a new thread before main() started. It spawns the thread on library load.
I think this is not a great practice. In my case it caused issues because I wanted to use signalfd and sigprocmask to set up some proper signal handling, however because the new thread is spawned before main(), there was no way for me to block the signals in that thread with sigprocmask. This means signalfd can’t be used at all if nvbuf_surface is linked.
Would it be possible to refactor the library with some sort of Setup() function that will spawn any needed worker threads, instead of starting them on library load?