OpenBLAS/driver
Jehan 1f6071590d Fix usage of TerminateThread() causing critical section corruption.
This patch was submitted to the GIMP project by a publisher wishing to
keep confidentiality (hence anonymously). I just pass along the patch.
Here is the patch explanation which came with:

First they remind us what Microsoft documentation says about
TerminateThread:
> TerminateThread is a dangerous function that should only be used in
> the most extreme cases. You should call TerminateThread only if you
> know exactly what the target thread is doing, and you control all of
> the code that the target thread could possibly be running at the time
> of the termination.
(https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread)

Then they say that 5 milliseconds time-out might not be long enough for
the thread to exit gracefully. They propose to set it to a much higher
value (for instance here 5 seconds).

And finally you should always check the return value of
WaitForSingleObject(). In particular you want to run TerminateThread()
only if WaitForSingleObject() failed, not on success case.
2019-11-20 13:00:49 +01:00
..
level2 Revert "Avoid taking root of negative number in symv_thread.c" 2019-10-01 23:50:41 +02:00
level3 Avoid taking the root of a negative number 2018-12-22 22:30:29 +01:00
mapper Remove all trailing whitespace except lapack-netlib 2014-06-27 12:05:18 -07:00
others Fix usage of TerminateThread() causing critical section corruption. 2019-11-20 13:00:49 +01:00