aboutsummaryrefslogtreecommitdiff
path: root/protocols/inspircd2.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/inspircd2.c')
-rw-r--r--protocols/inspircd2.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/protocols/inspircd2.c b/protocols/inspircd2.c
index 8111742..6c16598 100644
--- a/protocols/inspircd2.c
+++ b/protocols/inspircd2.c
@@ -38,6 +38,7 @@
#include "../haxstring.h"
#include "../haxstring_utils.h"
#include "../main.h"
+#include "../mutex.h"
#include "../server_network.h"
#include "inspircd2.h"
@@ -216,7 +217,7 @@ void * inspircd2_protocol_connection(void *type) {
goto inspircd2_protocol_handle_connection_close;
timeout++;
- pthread_mutex_lock(&(state_lock));
+ mutex_lock(&(state_lock));
networks[net].send(handle, STRING(":"));
networks[net].send(handle, SID);
networks[net].send(handle, STRING(" PING "));
@@ -229,7 +230,7 @@ void * inspircd2_protocol_connection(void *type) {
server->awaiting_pong = 1;
gettimeofday(&(server->last_ping), 0);
- pthread_mutex_unlock(&(state_lock));
+ mutex_unlock(&(state_lock));
} else {
goto inspircd2_protocol_handle_connection_close;
}
@@ -374,7 +375,7 @@ void * inspircd2_protocol_connection(void *type) {
i++;
}
- pthread_mutex_lock(&state_lock);
+ mutex_lock(&state_lock);
if (source.len != 0) {
struct server_info *server;
@@ -423,7 +424,7 @@ void * inspircd2_protocol_connection(void *type) {
WRITES(2, STRING("\n"));
do_trivial_reloads();
- pthread_mutex_unlock(&state_lock);
+ mutex_unlock(&state_lock);
memmove(full_msg.data, full_msg.data + msg_len + 1, full_msg.len - msg_len - 1);
full_msg.len -= msg_len + 1;
void *tmp = realloc(full_msg.data, full_msg.len);
@@ -433,14 +434,14 @@ void * inspircd2_protocol_connection(void *type) {
}
inspircd2_protocol_handle_connection_unlock_close:
- pthread_mutex_unlock(&state_lock);
+ mutex_unlock(&state_lock);
inspircd2_protocol_handle_connection_close:
free(full_msg.data);
if (ready) {
- pthread_mutex_lock(&(state_lock));
+ mutex_lock(&(state_lock));
unlink_server(config->sid, get_table_index(server_list, config->sid), self, INSPIRCD2_PROTOCOL);
- pthread_mutex_unlock(&(state_lock));
+ mutex_unlock(&(state_lock));
}
networks[net].close(fd, handle);