curl-curl/tests/server
Viktor Szakats 1c49f2f26d
windows: replace _beginthreadex() with CreateThread()
Replace `_beginthreadex()` C runtime calls with native win32 API
`CreateThread()`. The latter was already used in `src/tool_doswin.c`
and in UWP and Windows CE builds before this patch. After this patch
all Windows flavors use it. To drop PP logic and simplify code.

While working on this it turned out that `src/tool_doswin.c` calls
`TerminateThread()`, which isn't recommended by the documentation,
except for "the most extreme cases". This patch makes no attempt
to change that code.
Ref: 9a2663322c #17572
Ref: https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread

Also:
- use `WaitForSingleObjectEx()` on all desktop Windows.
  Ref: 4be80d5109
  Ref: https://sourceforge.net/p/curl/feature-requests/82/
  Ref: https://learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-waitforsingleobjectex
- tests: drop redundant casts.
- lib3207: fix to not rely on thread macros when building without thread
  support.

Assisted-by: Jay Satiro
Assisted-by: Marcel Raad
Assisted-by: Michał Petryka
Follow-up to 38029101e2 #11625

Closes #18451
2025-09-20 01:28:35 +02:00
..
.checksrc checksrc: reduce exceptions, apply again to curlx 2025-06-27 17:33:35 +02:00
.gitignore tests: always make bundles, adapt build and tests 2025-06-14 21:08:23 +02:00
CMakeLists.txt build: tidy up compiler definition for tests 2025-07-28 12:43:01 +02:00
dnsd.c hostip: cache negative name resolves 2025-08-05 08:05:31 +02:00
first.c tests: make individual test sources compile cleanly 2025-06-22 15:58:15 +02:00
first.h build: tidy up compiler definition for tests 2025-07-28 12:43:01 +02:00
getpart.c GHA/checksrc: expand spellcheck, fix issues found 2025-07-21 16:09:01 +02:00
Makefile.am build: tidy up compiler definition for tests 2025-07-28 12:43:01 +02:00
Makefile.inc build: split .c and .h file lists in tests 2025-06-26 10:20:41 +02:00
memptr.c windows: drop redundant curl_wcsdup_callback callback 2025-07-08 13:33:38 +02:00
mqttd.c tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
resolve.c tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
rtspd.c build: disable TCP_NODELAY for emscripten 2025-08-05 00:34:24 +02:00
sockfilt.c windows: replace _beginthreadex() with CreateThread() 2025-09-20 01:28:35 +02:00
socksd.c tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
sws.c sws: fix checking sscanf() return value 2025-09-16 13:34:51 +02:00
tftpd.c tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
util.c windows: replace _beginthreadex() with CreateThread() 2025-09-20 01:28:35 +02:00