You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dlclose() is called for any firebird library, shutdownThread sometimes does not close successfully. This is due to the frame between finalizing semaphore release and actual thread completion, during which OS can throw that thread away from CPU, and when it's activated once again - code to be executed is not available any more.
The only reliable way to know that thread is really finished is to use thread-level (pthread_join, WaitForSingleObject) OS-dependent functions. To avoid OS dependency in main code added ThreadHandle typedef (address of such variable is passed to gds__thread_start()) and 2 new functions - THD_detach() and THD_wait_for_completion(). Ideally THD_wait_for_completion() should be used all over the engine instead of finalizing semaphores, but I've started with shutdownThread(), where it's specially critical.
Also fixed posix's gds__thread_start() making it not ignore last parameter. Solaris threads are not fixed.
Submitted by: @AlexPeshkoff
When dlclose() is called for any firebird library, shutdownThread sometimes does not close successfully. This is due to the frame between finalizing semaphore release and actual thread completion, during which OS can throw that thread away from CPU, and when it's activated once again - code to be executed is not available any more.
Commits: cdc4458
The text was updated successfully, but these errors were encountered: