curl/tests/libtest
Stefan Eissing 82009c4220
share: concurrency handling, easy updates
Replace the `volatile int dirty` with a reference counter
protected by a mutex when available.

Solve the problem of when to call application's lock function
by adding a volatile flag that indicates a share has been added
to easy handles in its lifetime. That flag ever goes from
FALSE to TRUE, so volatile might work (in the absence of a mutex).

(The problem is that the lock/unlock functions need 2-3
`curl_share_setopt()` invocations to become usable and there
is no way of telling if the third will ever happen. Calling
the lock function before the 3rd setopt may crash the
application.)

When removing a share from an easy handle (or replacing it with
another share), detach the easy connection on a share with a
connection pool.

When cleaning up a share, allow this even if it is still used in
easy handles. It will be destroyed when the reference count
drops to 0.

Closes #20870
2026-03-21 14:42:49 +01:00
..
.gitignore
cli_ftp_upload.c
cli_h2_pausing.c
cli_h2_serverpush.c
cli_h2_upgrade_extreme.c
cli_hx_download.c dnscache: own source file, improvements 2026-03-21 12:04:36 +01:00
cli_hx_upload.c cmake: add CURL_GCC_ANALYZER option, enable in CI, fix/silence 2026-03-16 11:49:34 +01:00
cli_tls_session_reuse.c
cli_upload_pausing.c
cli_ws_data.c
cli_ws_pingpong.c
CMakeLists.txt
first.c
first.h libtest: drop duplicate include 2026-03-21 13:14:46 +01:00
lib500.c
lib501.c
lib502.c
lib503.c
lib504.c
lib505.c
lib506.c
lib507.c
lib508.c
lib509.c
lib510.c
lib511.c
lib512.c
lib513.c
lib514.c
lib515.c
lib516.c
lib517.c
lib518.c
lib519.c
lib520.c
lib521.c
lib523.c
lib524.c
lib525.c
lib526.c
lib530.c multi: improve wakeup and wait code 2026-03-21 11:58:24 +01:00
lib533.c
lib536.c
lib537.c
lib539.c
lib540.c
lib541.c
lib542.c
lib543.c
lib544.c
lib547.c
lib549.c
lib552.c
lib553.c
lib554.c
lib555.c
lib556.c
lib557.c gcc: guard #pragma diagnostic in core code for <4.6, disable picky warnings 2026-03-18 11:33:37 +01:00
lib558.c
lib559.c
lib560.c
lib562.c
lib564.c
lib566.c
lib567.c
lib568.c
lib569.c
lib570.c
lib571.c
lib572.c
lib573.c
lib574.c
lib575.c
lib576.c
lib578.c
lib579.c
lib582.c
lib583.c
lib586.c
lib589.c
lib590.c
lib591.c
lib597.c
lib598.c
lib599.c
lib643.c
lib650.c
lib651.c
lib652.c
lib653.c
lib654.c
lib655.c
lib658.c
lib659.c
lib661.c
lib666.c
lib667.c
lib668.c
lib670.c
lib674.c
lib676.c
lib677.c
lib678.c
lib694.c
lib695.c
lib751.c
lib753.c
lib757.c
lib758.c multi: improve wakeup and wait code 2026-03-21 11:58:24 +01:00
lib766.c
lib1156.c
lib1301.c
lib1308.c
lib1485.c
lib1500.c
lib1501.c
lib1502.c
lib1506.c
lib1507.c
lib1508.c
lib1509.c
lib1510.c
lib1511.c
lib1512.c
lib1513.c
lib1514.c
lib1515.c
lib1517.c
lib1518.c
lib1520.c
lib1522.c
lib1523.c
lib1525.c
lib1526.c
lib1527.c
lib1528.c
lib1529.c
lib1530.c
lib1531.c
lib1532.c
lib1533.c
lib1534.c
lib1535.c
lib1536.c
lib1537.c
lib1538.c
lib1540.c
lib1541.c
lib1542.c
lib1545.c
lib1549.c
lib1550.c
lib1551.c
lib1552.c
lib1553.c
lib1554.c
lib1555.c
lib1556.c
lib1557.c
lib1558.c
lib1559.c
lib1560.c
lib1564.c
lib1565.c
lib1567.c
lib1568.c
lib1569.c
lib1571.c
lib1576.c
lib1582.c
lib1591.c
lib1592.c
lib1593.c
lib1594.c
lib1597.c
lib1598.c
lib1599.c
lib1662.c
lib1900.c
lib1901.c
lib1902.c
lib1903.c
lib1905.c
lib1906.c
lib1907.c
lib1908.c
lib1910.c
lib1911.c
lib1912.c
lib1913.c
lib1915.c
lib1916.c
lib1918.c
lib1919.c
lib1920.c
lib1933.c
lib1934.c
lib1935.c
lib1936.c
lib1937.c
lib1938.c
lib1939.c
lib1940.c
lib1945.c
lib1947.c
lib1948.c
lib1955.c
lib1956.c
lib1957.c
lib1958.c
lib1959.c
lib1960.c
lib1964.c
lib1965.c urlapi: verify the last letter of a scheme when set explictly 2026-03-11 23:48:53 +01:00
lib1970.c
lib1971.c
lib1972.c
lib1973.c
lib1974.c
lib1975.c
lib1977.c
lib1978.c
lib2023.c
lib2032.c
lib2082.c
lib2301.c
lib2302.c
lib2304.c
lib2306.c
lib2308.c
lib2309.c
lib2402.c
lib2404.c
lib2405.c multi: improve wakeup and wait code 2026-03-21 11:58:24 +01:00
lib2502.c
lib2700.c
lib3010.c
lib3025.c
lib3026.c
lib3027.c
lib3033.c
lib3034.c
lib3100.c
lib3101.c
lib3102.c
lib3103.c
lib3104.c
lib3105.c
lib3207.c share: concurrency handling, easy updates 2026-03-21 14:42:49 +01:00
lib3208.c
Makefile.am autotools: limit checksrc target to ignore non-repo test sources 2026-03-12 01:45:24 +01:00
Makefile.inc urlapi: verify the last letter of a scheme when set explictly 2026-03-11 23:48:53 +01:00
memptr.c
mk-lib1521.pl mk-lib1521.pl: fix 4 callback function types passed to setopt 2026-03-20 01:42:47 +01:00
test307.pl
test610.pl
test613.pl scripts: harden / tidy up more Perl system() calls 2026-03-19 14:26:56 +01:00
test1013.pl
test1022.pl
testtrace.c
testtrace.h
testutil.c
testutil.h
unitcheck.h build: limit unitprotos.h include to units target 2026-03-20 11:31:35 +01:00