+static void *http_request_datashare_locks_init(void)
+{
+ int i;
+ http_request_datashare_lock *locks = pecalloc(CURL_LOCK_DATA_LAST, sizeof(http_request_datashare_lock), 1);
+
+ if (locks) {
+ for (i = 0; i < CURL_LOCK_DATA_LAST; ++i) {
+ locks[i].mx = tsrm_mutex_alloc();
+ }
+ }
+
+ return locks;
+}
+
+static void http_request_datashare_locks_dtor(void *l)
+{
+ int i;
+ http_request_datashare_lock *locks = (http_request_datashare_lock *) l;
+
+ for (i = 0; i < CURL_LOCK_DATA_LAST; ++i) {
+ tsrm_mutex_free(locks[i].mx);
+ }
+ pefree(locks, 1);
+}
+