]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
thrdqueue: make thrdq_await_done only for unit tests
authorDaniel Stenberg <daniel@haxx.se>
Mon, 4 May 2026 21:44:25 +0000 (23:44 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 May 2026 06:55:49 +0000 (08:55 +0200)
It is not used for anything else, so drop Curl_ and make it conditional
accordingly.

Closes #21499

lib/thrdqueue.c
tests/unit/unit3301.c

index 1521ccfbee10ccd8bb13b8b93bae5d9c4e19920e..f68f8e17973c1c427acb20c01ee8395ee65f8776 100644 (file)
@@ -351,11 +351,16 @@ out:
   Curl_mutex_release(&tqueue->lock);
 }
 
-CURLcode Curl_thrdq_await_done(struct curl_thrdq *tqueue,
-                               uint32_t timeout_ms)
+#ifdef UNITTESTS
+/* @unittest 3301 */
+UNITTEST CURLcode thrdq_await_done(struct curl_thrdq *tqueue,
+                                   uint32_t timeout_ms);
+UNITTEST CURLcode thrdq_await_done(struct curl_thrdq *tqueue,
+                                   uint32_t timeout_ms)
 {
   return Curl_thrdpool_await_idle(tqueue->tpool, timeout_ms);
 }
+#endif
 
 CURLcode Curl_thrdq_set_props(struct curl_thrdq *tqueue,
                               uint32_t max_len,
index 9ded7bd93f0fed2a1615c070b3c39330b549d9ec..94b435da49564db6e3a7f151287d32faa9df7d9a 100644 (file)
@@ -110,7 +110,7 @@ static CURLcode test_unit3301(const char *arg)
     fail_unless(!r, "queue-b send");
   }
 
-  r = Curl_thrdq_await_done(tqueue, 0);
+  r = thrdq_await_done(tqueue, 0);
   fail_unless(!r, "queue-b await done");
 
   nrecvd = 0;