]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set an initial value for worker_id
authorNick Porter <nick@portercomputing.co.uk>
Mon, 23 Mar 2026 09:23:22 +0000 (09:23 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 23 Mar 2026 09:23:22 +0000 (09:23 +0000)
So that fr_schedule_workder_id() returns -1 when called from the main
thread, avoiding confusion with worker 0.

src/lib/io/schedule.c

index d6087c9f22a9c77c6f51416d724a259c957aad5b..a9af374ab305e10a5eda1ed02c16a218b9621d87 100644 (file)
@@ -101,7 +101,7 @@ struct fr_schedule_s {
        fr_worker_t     *single_worker;         //!< for single-threaded mode
 };
 
-static _Thread_local int worker_id;            //!< Internal ID of the current worker thread.
+static _Thread_local int worker_id = -1;       //!< Internal ID of the current worker thread.
 
 /** Return the worker id for the current thread
  *