- if (!CtdlThreadCheckStop()) // Only reschedule if system is not stopping
- CtdlThreadSchedule("IGnet Network", CTDLTHREAD_BIGSTACK, network_do_queue, NULL, time(NULL) + 60);
- else
+
+ /* Reschedule this task to happen again periodically, unless the thread system indicates
+ * that the server is shutting down.
+ */
+ if (!CtdlThreadCheckStop()) {
+ CtdlThreadSchedule("IGnet Network", CTDLTHREAD_BIGSTACK,
+ network_do_queue, NULL, time(NULL) + 60
+ );
+ }
+ else {