{
int savederrno = 0;
- savederrno = pthread_rwlock_init(&knet_h->list_rwlock, NULL);
+ savederrno = pthread_rwlock_init(&knet_h->global_rwlock, NULL);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to initialize list rwlock: %s",
strerror(savederrno));
static void _destroy_locks(knet_handle_t knet_h)
{
knet_h->lock_init_done = 0;
- pthread_rwlock_destroy(&knet_h->list_rwlock);
+ pthread_rwlock_destroy(&knet_h->global_rwlock);
pthread_rwlock_destroy(&knet_h->listener_rwlock);
pthread_rwlock_destroy(&knet_h->host_rwlock);
pthread_mutex_destroy(&knet_h->host_mutex);
goto exit_nolock;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
log_err(knet_h, KNET_SUB_HANDLE,
"Unable to free handle: host(s) or listener(s) are still active: %s",
strerror(savederrno));
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return -1;
}
knet_h->fini_in_progress = 1;
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
_stop_threads(knet_h);
_close_epolls(knet_h);
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
knet_h->sock_notify_fn = sock_notify_fn;
log_debug(knet_h, KNET_SUB_HANDLE, "sock_notify_fn enabled");
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
knet_h->sockfd[*channel].in_use = 1;
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
memset(&knet_h->sockfd[channel], 0, sizeof(struct knet_sock));
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get read lock: %s",
strerror(savederrno));
*datafd = knet_h->sockfd[channel].sockfd[0];
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get read lock: %s",
strerror(savederrno));
}
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
log_debug(knet_h, KNET_SUB_HANDLE, "dst_host_filter_fn disabled");
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
log_debug(knet_h, KNET_SUB_HANDLE, "Data forwarding is disabled");
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
*interval = knet_h->pmtud_interval;
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
pthread_mutex_unlock(&knet_h->pmtud_timer_mutex);
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
log_debug(knet_h, KNET_SUB_HANDLE, "pmtud_notify_fn disabled");
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
*link_mtu = knet_h->link_mtu;
*data_mtu = knet_h->data_mtu;
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
strerror(savederrno));
}
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get read lock: %s",
strerror(savederrno));
savederrno = errno;
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HANDLE, "Unable to get read lock: %s",
strerror(savederrno));
savederrno = errno;
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get write lock: %s",
strerror(savederrno));
_host_list_update(knet_h);
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
if (err < 0) {
free(host);
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get write lock: %s",
strerror(savederrno));
_host_list_update(knet_h);
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get write lock: %s",
strerror(savederrno));
snprintf(knet_h->host_index[host_id]->name, KNET_MAX_HOST_LEN - 1, "%s", name);
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get read lock: %s",
strerror(savederrno));
err = 1;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get read lock: %s",
strerror(savederrno));
}
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get read lock: %s",
strerror(savederrno));
*host_ids_entries = knet_h->host_ids_entries;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get write lock: %s",
strerror(savederrno));
}
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get read lock: %s",
strerror(savederrno));
*policy = knet_h->host_index[host_id]->link_handler_policy;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get read lock: %s",
strerror(savederrno));
memmove(status, &host->status, sizeof(struct knet_host_status));
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_HOST, "Unable to get write lock: %s",
strerror(savederrno));
log_debug(knet_h, KNET_SUB_HOST, "host_status_change_notify_fn disabled");
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
pthread_t dst_link_handler_thread;
pthread_t pmtud_link_handler_thread;
int lock_init_done;
- pthread_rwlock_t list_rwlock; /* global config lock */
+ pthread_rwlock_t global_rwlock; /* global config lock */
pthread_rwlock_t listener_rwlock; /* listener add/rm lock, can switch to mutex? */
pthread_rwlock_t host_rwlock; /* send_host_info lock, can switch to mutex? */
pthread_mutex_t host_mutex; /* host mutex for cond wait on pckt send, switch to mutex/sync_send ? */
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get write lock: %s",
strerror(savederrno));
link->configured = 1;
link->pong_count = KNET_LINK_DEFAULT_PONG_COUNT;
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
memmove(dst_addr, &link->dst_addr, sizeof(struct sockaddr_storage));
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
* a read lock is sufficient as all functions invoked by
* this code are already thread safe.
*/
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
link->host_info_up_sent = 0;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
*enabled = link->status.enabled;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get write lock: %s",
strerror(savederrno));
host_id, link_id, link->pong_count);
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
*pong_count = link->pong_count;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get write lock: %s",
strerror(savederrno));
host_id, link_id, link->ping_interval, link->pong_timeout, precision);
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
*precision = link->latency_fix;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get write lock: %s",
strerror(savederrno));
host_id, link_id, link->priority);
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
*priority = link->priority;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
*link_ids_entries = count;
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_LINK, "Unable to get read lock: %s",
strerror(savederrno));
memmove(status, &link->status, sizeof(struct knet_link_status));
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
}
return -1;
}
- savederrno = pthread_rwlock_wrlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_wrlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, subsystem, "Unable to get write lock: %s",
strerror(savederrno));
knet_h->log_levels[subsystem] = level;
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, subsystem, "Unable to get write lock: %s",
strerror(savederrno));
*level = knet_h->log_levels[subsystem];
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return 0;
}
* if we get an EINVAL and locking is initialized, then
* we are getting a real error and we need to stop
*/
- err = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ err = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if ((err == EINVAL) && (knet_h->lock_init_done))
return;
* unlock only if we are holding the lock
*/
if (!err)
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
while (byte_cnt < sizeof(struct knet_log_msg)) {
len = write(knet_h->logfd, &msg, sizeof(struct knet_log_msg) - byte_cnt);
return;
}
- if (pthread_rwlock_rdlock(&knet_h->list_rwlock) != 0) {
+ if (pthread_rwlock_rdlock(&knet_h->global_rwlock) != 0) {
log_debug(knet_h, KNET_SUB_SWITCH_T, "Unable to get read lock");
return;
}
_host_dstcache_update_sync(knet_h, host);
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
return;
}
while (!knet_h->fini_in_progress) {
usleep(KNET_PING_TIMERES);
- if (pthread_rwlock_rdlock(&knet_h->list_rwlock) != 0) {
+ if (pthread_rwlock_rdlock(&knet_h->global_rwlock) != 0) {
log_debug(knet_h, KNET_SUB_HB_T, "Unable to get read lock");
continue;
}
}
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
}
return NULL;
if (knet_h->pmtud_fini_requested)
continue;
- if (pthread_rwlock_rdlock(&knet_h->list_rwlock) != 0) {
+ if (pthread_rwlock_rdlock(&knet_h->global_rwlock) != 0) {
log_debug(knet_h, KNET_SUB_PMTUD_T, "Unable to get read lock");
continue;
}
}
interrupt:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
}
return NULL;
return -1;
}
- savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ savederrno = pthread_rwlock_rdlock(&knet_h->global_rwlock);
if (savederrno) {
log_err(knet_h, KNET_SUB_SEND_T, "Unable to get read lock: %s",
strerror(savederrno));
pthread_mutex_unlock(&knet_h->tx_mutex);
out:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = savederrno;
return err;
int msg_recv, i;
int savederrno, docallback = 0;
- if (pthread_rwlock_rdlock(&knet_h->list_rwlock) != 0) {
+ if (pthread_rwlock_rdlock(&knet_h->global_rwlock) != 0) {
log_debug(knet_h, KNET_SUB_SEND_T, "Unable to get read lock");
return;
}
}
out_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
if (inlen < 0) {
struct epoll_event ev;
- if (pthread_rwlock_wrlock(&knet_h->list_rwlock) != 0) {
+ if (pthread_rwlock_wrlock(&knet_h->global_rwlock) != 0) {
log_debug(knet_h, KNET_SUB_SEND_T, "Unable to get read lock");
goto callback;
}
knet_h->sockfd[channel].has_error = 1;
}
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
}
callback:
{
int i, msg_recv;
- if (pthread_rwlock_rdlock(&knet_h->list_rwlock) != 0) {
+ if (pthread_rwlock_rdlock(&knet_h->global_rwlock) != 0) {
log_debug(knet_h, KNET_SUB_LINK_T, "Unable to get read lock");
return;
}
}
exit_unlock:
- pthread_rwlock_unlock(&knet_h->list_rwlock);
+ pthread_rwlock_unlock(&knet_h->global_rwlock);
}
void *_handle_recv_from_links_thread(void *data)