+ #ifdef HAVE_THREADS
+ pthread_t tid[worker_threads];
+ int tid_id = 0;
+ for(tid_id = 0; tid_id < worker_threads; tid_id++) {
+ running_threads++;
+ pthread_create(&tid[tid_id], NULL, thread_main, NULL);
+ }
+ int usleep_delay = 1000000 / TICKS_PER_SECOND;
+ while(running) {
+ timeq_tick();
+ loop_bots();
+ qserver_loop();
+ queue_loop();
+ usleep(usleep_delay);
+ }
+ for(tid_id = 0; tid_id < worker_threads; tid_id++) {
+ pthread_join(tid[tid_id], NULL);
+ }
+ running_threads = 0;
+ #else
+ time_t socket_wait;