+#if HAVE_THREADS
+static void clientsocket_start_of_recv(unsigned long tid) {
+ SYNCHRONIZE(whohandler_sync);
+ 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);
+}
+
+static void clientsocket_end_of_recv(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;
+ }
+ DESYNCHRONIZE(whohandler_sync);
+}
+
+int clientsocket_parseorder_top(unsigned long tid) {
+ if(parse_order && parse_order->tid == tid)
+ return 1;
+ else
+ return 0;
+}
+#endif
+