#include "system.h"
#include <pthread.h>
-#include <stdatomic.h>
#include "adns.h"
#include "devtools.h"
abort();
}
- assert(pthread_cond_signal(&mesh->adns_cond) == 0);
+ pthread_cond_signal(&mesh->adns_cond);
pthread_join(mesh->adns_thread, NULL);
meshlink_queue_exit(&mesh->adns_queue);
abort();
}
- assert(pthread_cond_signal(&mesh->adns_cond) == 0);
+ pthread_cond_signal(&mesh->adns_cond);
}
struct adns_blocking_info {
info->ai = NULL;
}
- assert(pthread_mutex_lock(&info->mutex) == 0);
+ if(pthread_mutex_lock(&info->mutex) != 0) {
+ abort();
+ }
bool cleanup = info->done;
if(!info->done) {
info->done = true;
- assert(pthread_cond_signal(&info->cond) == 0);
+ pthread_cond_signal(&info->cond);
}
- assert(pthread_mutex_unlock(&info->mutex) == 0);
+ pthread_mutex_unlock(&info->mutex);
if(cleanup) {
free(info->host);
info->host = host;
info->serv = serv;
info->socktype = socktype;
- assert(pthread_mutex_init(&info->mutex, NULL) == 0);
- assert(pthread_cond_init(&info->cond, NULL) == 0);
+ pthread_mutex_init(&info->mutex, NULL);
+ pthread_cond_init(&info->cond, NULL);
struct timespec deadline;
clock_gettime(CLOCK_REALTIME, &deadline);
free(info);
return NULL;
} else {
- assert(pthread_detach(thread) == 0);
+ pthread_detach(thread);
+ }
+
+ if(pthread_mutex_lock(&info->mutex) != 0) {
+ abort();
}
- assert(pthread_mutex_lock(&info->mutex) == 0);
- assert(pthread_cond_timedwait(&info->cond, &info->mutex, &deadline) == 0);
+ pthread_cond_timedwait(&info->cond, &info->mutex, &deadline);
struct addrinfo *result = NULL;
bool cleanup = info->done;
info->done = true;
}
- assert(pthread_mutex_unlock(&info->mutex) == 0);
+ pthread_mutex_unlock(&info->mutex);
if(cleanup) {
free(info->host);