perror("malloc() failed");
return NULL;
}
+ SYNCHRONIZE(cache_sync);
entry->next = NULL;
if(client->whoqueue_last) {
client->whoqueue_last->next = entry;
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;
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;
}
client->whoqueue_last = NULL;
client->whoqueue_first = NULL;
+ DESYNCHRONIZE(cache_sync);
}
void get_userlist(struct ChanNode *chan, userlist_callback_t callback, void *data) {