1CURLSHOPT_UNLOCKFUNC(3) libcurl Manual CURLSHOPT_UNLOCKFUNC(3)
2
3
4
6 CURLSHOPT_UNLOCKFUNC - mutex unlock callback
7
9 #include <curl/curl.h>
10
11 void unlockcb(CURL *handle, curl_lock_data data, curl_lock_access access,
12 void *userptr);
13
14 CURLSHcode curl_share_setopt(CURLSH *share, CURLSHOPT_UNLOCKFUNC, unlockcb);
15
17 Set a mutex unlock callback for the share object. There's a correspond‐
18 ing CURLSHOPT_LOCKFUNC(3) callback called when the mutex is first
19 locked.
20
21 The unlockcb argument must be a pointer to a function matching the pro‐
22 totype shown above. The arguments to the callback are:
23
24 handle is the currently active easy handle in use when the share object
25 is released.
26
27 The data argument tells what kind of data libcurl wants to unlock. Make
28 sure that the callback uses a different lock for each kind of data.
29
30 access defines what access type libcurl wants, shared or single.
31
32 userptr is the private pointer you set with CURLSHOPT_USERDATA. This
33 pointer is not used by libcurl itself.
34
36 All
37
39 CURLSHcode sh
40 share = curl_share_init();
41 sh = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, mutex_unlock);
42 if(sh)
43 printf("Error: %s\n", curl_share_strerror(sh));
44
46 Added in 7.10
47
49 CURLSHE_OK (zero) means that the option was set properly, non-zero
50 means an error occurred. See libcurl-errors(3) for the full list with
51 descriptions.
52
54 CURLSHOPT_LOCKFUNC(3), curl_share_setopt(3), curl_share_cleanup(3),
55 curl_share_init(3)
56
57
58
59libcurl 7.82.0 November 12, 2021 CURLSHOPT_UNLOCKFUNC(3)