在 2026-10-7 18:35, Kirill Makurin 写道:
Hello, has anyone else taken a look yet?
I will take a look later maybe tomorrow. For the time being, here are some 
findings by DeepSeek:


In 0023 there's
diff --git 
a/mingw-w64-libraries/winpthreads/tests/clock/clock_gettime-process_cputime.c 
b/mingw-w64-libraries/winpthreads/tests/clock/clock_gettime-process_cputime.c
index 9c6e57560..c52ffb230 100644
--- 
a/mingw-w64-libraries/winpthreads/tests/clock/clock_gettime-process_cputime.c
+++ 
b/mingw-w64-libraries/winpthreads/tests/clock/clock_gettime-process_cputime.c
@@ -35,8 +35,18 @@ int main(void)
 {
   struct timespec ts1;
   struct timespec ts2;
+  int error_code;
- assert(clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts1) == 0);
+  error_code = clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts1);
+  errno = 0;
+  assert(error_code == 0 || (error_code = errno) == ENOTSUP);

Looks like this `errno = 0` should be moved in front of 
`clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts1)`.

And also clock_settime-process_cputime.c.


In 0030 there's
+  /**
+   * Total sleep time in milliseconds.
+   */
+  unsigned __int64 totalSleepTime = winpthreads_timespec_ms (request);
...
+  do {
+    /**
+     * We can sleep for at most `INFINITE - 1` milliseconds at a time.
+     */
+    unsigned sleepTime;
...
+    totalSleepTime -= sleepTime;
+    error_code      = _pthread_delay_np_ms (sleepTime);
+  } while (totalSleepTime > 0 && likely (error_code == 0));
+
...
+      if (likely (elapsedSleepTime < totalSleepTime)) {
+        remainingSleepTime = totalSleepTime - elapsedSleepTime;
`totalSleepTime` is no longer the value that was returned by `winpthreads_timespec_ms()`, so this looks incorrect.


In 0032 there's
-#include "pthread_compat.h"
+#include <pthread_compat.h>

Since this includes a header from the same directory, I do suggest this be kept 
with quotes.

pthread.h also contains `#include <pthread_unistd.h>` which you can fix later.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to