Conversation
There was a problem hiding this comment.
Pull request overview
Prioritizes native Windows threading over POSIX threads in curl_threads.c.
Changes:
- Reorders thread implementation selection.
- Reorders mutex and condition-variable implementation selection.
Suppressed comments (1)
lib/curl_threads.c:139
- The mutex/condition implementation has also switched to Win32 precedence, while
curl_threads.h:29-56still selectspthread_mutex_t,pthread_cond_t, andpthread_twheneverHAVE_THREADS_POSIXis defined. With both macros set, these definitions conflict with the public declarations and Win32 callers here. Reorder the header conditional consistently with this branch.
#ifdef _WIN32
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Syncing with build systems, which already did so, skipping pthreads detection on Windows.
e1103e3 to
2797f10
Compare
|
Does it make sense to conditionally use the faster Win8+ |
I've never seen that used in any project that I've worked on. How do you know it is faster? Also, it has some caveats: Note: WaitOnAddress is guaranteed to return when the address is signaled, but it is also allowed to return for other reasons. For this reason, after WaitOnAddress returns the caller should compare the new value with the original undesired value to confirm that the value has actually changed. For example, the following circumstances can result in waking the thread early:
|
In general, I'm not a big fan of doing version-conditional things (esp. runtime-conditional) Also seconding Jay, that new/rarely used features may have suprises or bugs. For |
To remove a build difference between mingw-w64 and MSVC builds, simplify and save the cost of detection/verification in CI. `gettimeofday()` was used in `curl_threads.c` in codepath practically unreachable in Windows builds, and in `tool_writeout.c` that was a fallback to `time()` for targets without it. Ref: curl#22593
To remove a build difference between mingw-w64 and MSVC builds, simplify and save the cost of detection/verification in CI. `gettimeofday()` was used in `curl_threads.c` in codepath practically unreachable in Windows builds, and in `tool_writeout.c` that was a fallback to `time()` for targets without it. Ref: curl#22593
To remove a build difference between mingw-w64 and MSVC builds (where mingw-w64 has it, while MSVC does not). Also to simplify and save the cost of detection/verification in CI. `gettimeofday()` was used in `curl_threads.c` in codepath practically unreachable in Windows builds, and in `tool_writeout.c` that falls back to `time()` for targets without it. Ref: #22593 Closes #22594
Syncing with build systems, which already enforce this.
easy_lock.halso had this precedence before this patch.