X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2FHandleInfoHandler.c;h=99d19658b73c33d6b24abb729988eecbc44cc746;hp=c194935eab2c4906e7de94904e8e626a58bd4137;hb=55831bf424312a6908ca07a904f288fba0919a9a;hpb=bb5692b9cbff069abbf9573c81e86c3cd2061ceb diff --git a/src/HandleInfoHandler.c b/src/HandleInfoHandler.c index c194935..99d1965 100644 --- a/src/HandleInfoHandler.c +++ b/src/HandleInfoHandler.c @@ -18,6 +18,7 @@ #include "HandleInfoHandler.h" #include "ClientSocket.h" #include "UserNode.h" +#include "ChanNode.h" #include "IRCEvents.h" #include "tools.h" @@ -40,17 +41,20 @@ static struct HandleInfoQueueEntry* addHandleInfoQueueEntry(struct ClientSocket perror("malloc() failed"); return NULL; } + SYNCHRONIZE(cache_sync); entry->next = NULL; if(client->handleinfo_last) client->handleinfo_last->next = entry; else client->handleinfo_first = entry; client->handleinfo_last = entry; + DESYNCHRONIZE(cache_sync); return entry; } static struct HandleInfoQueueEntry* getNextHandleInfoQueueEntry(struct ClientSocket *client, int freeEntry) { if(!client->handleinfo_first) return NULL; + SYNCHRONIZE(cache_sync); struct HandleInfoQueueEntry *entry = client->handleinfo_first; if(freeEntry) { client->handleinfo_first = entry->next; @@ -58,11 +62,13 @@ static struct HandleInfoQueueEntry* getNextHandleInfoQueueEntry(struct ClientSoc client->handleinfo_last = NULL; } } + DESYNCHRONIZE(cache_sync); return entry; } void clear_handleinfoqueue(struct ClientSocket *client) { if(!client->handleinfo_first) return; + SYNCHRONIZE(cache_sync); struct HandleInfoQueueEntry *entry, *next; for(entry = client->handleinfo_first; entry; entry = next) { next = entry->next; @@ -70,6 +76,7 @@ void clear_handleinfoqueue(struct ClientSocket *client) { } client->handleinfo_last = NULL; client->handleinfo_first = NULL; + DESYNCHRONIZE(cache_sync); } void lookup_authname(char *auth, authlookup_callback_t callback, void *data) {