On 2020-09-21 18:31, Dimitry Sibiryakov wrote:
21.09.2020 17:28, Scott Morgan via Firebird-devel wrote:
Not as such, but it's relying on undefined behaviour (exiting an app
whilst worker threads are still active)

  On Windows it is defined behavior. Call to ExitProcess() made by default RTL will terminate all other threads.
  On Linux it is actually the same.


To be precise - fb_shutdown() performs some cleanup actions in the client. But they are organized in sligghtly different from engine way, therefore I've forgotten about them when answered first time. The most intresting for us - it's closing all opened sockets (suppose for non-TCP clients something similiar is done). As the result all I/O waits on them are finished at once, therefore if isc_attach_database() was waiting for reply from server it will get immediately disconnected.

I.e. you can safely call fb_shutdown() and after it wait for your thread completion.



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to