1CURLSHOPT_UNLOCKFUNC(3)         libcurl Manual         CURLSHOPT_UNLOCKFUNC(3)
2
3
4

NAME

6       CURLSHOPT_UNLOCKFUNC - mutex unlock callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       void unlockcb(CURL *handle, curl_lock_data data, void *userptr);
12
13       CURLSHcode curl_share_setopt(CURLSH *share, CURLSHOPT_UNLOCKFUNC, unlockcb);
14

DESCRIPTION

16       Set a mutex unlock callback for the share object. There's a correspond‐
17       ing CURLSHOPT_LOCKFUNC(3) callback  called  when  the  mutex  is  first
18       locked.
19
20       The unlockcb argument must be a pointer to a function matching the pro‐
21       totype shown above. The arguments to the callback are:
22
23       handle is the currently active easy handle in use when the share object
24       is released.
25
26       The data argument tells what kind of data libcurl wants to unlock. Make
27       sure that the callback uses a different lock for each kind of data.
28
29       access defines what access type libcurl wants, shared or single.
30
31       userptr is the private pointer you set with  CURLSHOPT_USERDATA.   This
32       pointer is not used by libcurl itself.
33

PROTOCOLS

35       All
36

EXAMPLE

38         CURLSHcode sh;
39         share = curl_share_init();
40         sh = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, mutex_unlock);
41         if(sh)
42           printf("Error: %s\n", curl_share_strerror(sh));
43

AVAILABILITY

45       Added in 7.10
46

RETURN VALUE

48       CURLSHE_OK  (zero)  means  that  the  option was set properly, non-zero
49       means an error occurred. See libcurl-errors(3) for the full  list  with
50       descriptions.
51

SEE ALSO

53       CURLSHOPT_LOCKFUNC(3),   curl_share_setopt(3),   curl_share_cleanup(3),
54       curl_share_init(3)
55
56
57
58libcurl 7.85.0                   May 17, 2022          CURLSHOPT_UNLOCKFUNC(3)
Impressum