On Tue, 26 Jul 2022 12:58:09 GMT, Jorn Vernee <jver...@openjdk.org> wrote:

>> test/lib/native/testlib_threads.h line 50:
>> 
>>> 48: static void fatal(const char* message) {
>>> 49:     perror(message);
>>> 50:     exit(-1);
>> 
>> Won't work as intended for Windows APIs. I would print the result of 
>> `GetLastError()` instead.
>> 
>> Alternatively I am fine fine with just omitting the error code, because I 
>> think the old tests did not handle errors either. Or did we catch 
>> std::thread exceptions somewhere?
>
> The intent was to exit the test with a non-zero exit code, in order to avoid 
> any accidental false positives.
> 
> I could return the error code from `GetLastError` and from the respective 
> pthread apis as an exit code instead. Is that what you mean?

FWIW, `perror` just prints to `stderr`: 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/perror-wperror?view=msvc-170

-------------

PR: https://git.openjdk.org/jdk/pull/9599

Reply via email to