- unsigned long tid = syscall(SYS_gettid);
- struct WHOQueueEntry *entry;
- for(entry = client->whoqueue_first; entry; entry = entry->next) {
- if(entry->lock_tid == tid) {
- entry->lock_tid = 0;
- DESYNCHRONIZE(entry->lock_mutex);
- }
+ struct ParseOrder *entry, *last;
+ for(last = parse_order; last; last = last->next) {
+ if(last->next == NULL)
+ break;
+ }
+ entry = malloc(sizeof(*entry));
+ entry->tid = tid;
+ entry->next = NULL;
+ if(last)
+ last->next = entry;
+ else
+ parse_order = entry;
+ DESYNCHRONIZE(whohandler_sync);
+}
+
+void whohandler_end_of_recv(struct ClientSocket *client, unsigned long tid) {
+ SYNCHRONIZE(whohandler_sync);
+ struct ParseOrder *entry, *last = NULL;
+ for(entry = parse_order; entry; entry = entry->next) {
+ if(entry->tid == tid) {
+ if(last)
+ last->next = entry->next;
+ else
+ parse_order = entry->next;
+ free(entry);
+ break;
+ } else
+ last = entry;