Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The call to setThreadName() is moved to avoid a race condition that can happen with very short lived processes. If the process terminates very quickly e.g. is a google test runner or the msi.exe command called from a Makefile during a build, then very occasionally a crash can occur during process termination if setThreadName() when called from the newly created thread. This looks to be becauae the DLL it is trying to call gets unloaded between it getting a handle to the DLL and making the call. Moving the setThreadName() call to the creating thread avoids this problem. The issue was only ever seen with statically linked epics executables, I am unsure if the way a DLL based epics program unloads might avoid this, or just make it less likely but still possible. As mentioned above, the issue will only ever occur to threads that are created during process termination and so would not affect running IOCs
- Loading branch information