Fix error type check in InternalSetThreadPriority (#16959)
authorJan Vorlicek <janvorli@microsoft.com>
Thu, 15 Mar 2018 18:57:01 +0000 (19:57 +0100)
committerGitHub <noreply@github.com>
Thu, 15 Mar 2018 18:57:01 +0000 (19:57 +0100)
commit2f19f9bc20b6c18161555ca774eb6931d289202f
tree7105f88345c9a080d3e805b6e7978bcecc38bda6
parent4813d29b7ec505f698a0446d6d8614ec03651c9a
Fix error type check in InternalSetThreadPriority (#16959)

The pthread_setschedparam returns error code as a return value and not
in the errno as the existing code supposes. I have found it when a test
in the lab has failed to set the priority and asserted in this code, but
reported errno as 0.

Also fix the flaky DuplicateHandle test7 that was failing rarely due to the
fact that the secondary thread it has created didn't wait until the main thread
finished fiddling with the priority of that thread.
src/pal/src/thread/thread.cpp
src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp