X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2FWHOHandler.c;fp=src%2FWHOHandler.c;h=a8a55d91c693956cebd57329babecb6ec73fa829;hp=61f2ed2afec8f894ad4353eba8eea3e976cb4ad7;hb=55831bf424312a6908ca07a904f288fba0919a9a;hpb=0dfad39f7dacc3ca67298c9aecb5a7f8eec75fdc diff --git a/src/WHOHandler.c b/src/WHOHandler.c index 61f2ed2..a8a55d9 100644 --- a/src/WHOHandler.c +++ b/src/WHOHandler.c @@ -46,6 +46,7 @@ static struct WHOQueueEntry* addWHOQueueEntry(struct ClientSocket *client) { perror("malloc() failed"); return NULL; } + SYNCHRONIZE(cache_sync); entry->next = NULL; if(client->whoqueue_last) { client->whoqueue_last->next = entry; @@ -53,11 +54,13 @@ static struct WHOQueueEntry* addWHOQueueEntry(struct ClientSocket *client) { client->whoqueue_first = entry; } client->whoqueue_last = entry; + DESYNCHRONIZE(cache_sync); return entry; } static struct WHOQueueEntry* getNextWHOQueueEntry(struct ClientSocket *client, int freeEntry) { if(!client->whoqueue_first) return NULL; + SYNCHRONIZE(cache_sync); struct WHOQueueEntry *entry = client->whoqueue_first; if(freeEntry) { client->whoqueue_first = entry->next; @@ -65,11 +68,13 @@ static struct WHOQueueEntry* getNextWHOQueueEntry(struct ClientSocket *client, i client->whoqueue_last = NULL; } } + DESYNCHRONIZE(cache_sync); return entry; } void clear_whoqueue(struct ClientSocket *client) { if(!client->whoqueue_first) return; + SYNCHRONIZE(cache_sync); struct WHOQueueEntry *entry, *next; for(entry = client->whoqueue_first; entry; entry = next) { next = entry->next; @@ -77,6 +82,7 @@ void clear_whoqueue(struct ClientSocket *client) { } client->whoqueue_last = NULL; client->whoqueue_first = NULL; + DESYNCHRONIZE(cache_sync); } void get_userlist(struct ChanNode *chan, userlist_callback_t callback, void *data) {