Most threads are declared in different files and all working areas are defined as 'static' so there is no cross visibility, but still - full grep is in the bottom of this message.
I can assume that all threads are really stuck in the same method - onUnlockHook method is relatively special and getTimeNowNt method is the one where I have volatile/atomic magic. I will try without the magic later today just to see if it affects anything.
happening to my surprise.
$ grep -r chThdCreateStatic *
chibios/os/kernel/include/chthreads.h: Thread *chThdCreateStatic(void *wsp, size_t size,
chibios/os/kernel/src/chsys.c: chThdCreateStatic(_idle_thread_wa, sizeof(_idle_thread_wa), IDLEPRIO,
chibios/os/kernel/src/chthreads.c:Thread *chThdCreateStatic(void *wsp, size_t size,
chibios/os/kernel/src/chthreads.c: * - If the thread was spawned by @p chThdCreateStatic() or by
chibios/os/various/cpp_wrappers/ch.hpp: * - If the thread was spawned by @p chThdCreateStatic() or by
chibios/os/various/cpp_wrappers/ch.hpp: thread_ref = chThdCreateStatic(wa, sizeof(wa), prio, _thd_start, this);
console/console_io.c: chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, consoleThreadThreadEntryPoint, NULL);
console/status_loop.cpp: chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, (tfunc_t) lcdThread, engine);
console/status_loop.cpp: chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, (tfunc_t) tsStatusThread, engine);
console/status_loop.cpp: chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, (tfunc_t) blinkingThread, NULL);
console/tunerstudio/tunerstudio.cpp: chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, tsThreadEntryPoint, NULL);
controllers/algo/accel_enrichment.cpp:// chThdCreateStatic(aeThreadStack, sizeof(aeThreadStack), LOWPRIO, (tfunc_t) DiffEnrichmentThread, NULL);
controllers/alternatorController.cpp: chThdCreateStatic(ivThreadStack, sizeof(ivThreadStack), LOWPRIO, (tfunc_t)AltCtrlThread, NULL);
controllers/electronic_throttle.cpp: chThdCreateStatic(etbTreadStack, sizeof(etbTreadStack), NORMALPRIO, (tfunc_t) etbThread, NULL);
controllers/engine_controller.cpp: chThdCreateStatic(csThreadStack, sizeof(csThreadStack), LOWPRIO, (tfunc_t) csThread, NULL);
controllers/idle_thread.cpp: chThdCreateStatic(ivThreadStack, sizeof(ivThreadStack), NORMALPRIO, (tfunc_t) ivThread, NULL);
controllers/injector_central.cpp: chThdCreateStatic(benchThreadStack, sizeof(benchThreadStack), NORMALPRIO, (tfunc_t) benchThread, NULL);
controllers/malfunction_indicator.cpp: chThdCreateStatic(mfiThreadStack, sizeof(mfiThreadStack), LOWPRIO, (tfunc_t) mfiThread, NULL);
development/engine_emulator.cpp: chThdCreateStatic(eeThreadStack, sizeof(eeThreadStack), NORMALPRIO, (tfunc_t) eeThread, engine);
development/test/testbmk.c: threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-1, thread1, NULL);
development/test/testbmk.c: threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1, thread1, NULL);
development/test/testbmk.c: threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1, thread1, NULL);
development/test/testbmk.c: threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-2, thread2, NULL);
development/test/testbmk.c: threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-3, thread2, NULL);
development/test/testbmk.c: threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()-4, thread2, NULL);
development/test/testbmk.c: threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()-5, thread2, NULL);
development/test/testbmk.c: tp = threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1, thread4, NULL);
development/test/testbmk.c: * @p chThdCreateStatic() / @p chThdExit() / @p chThdWait() cycle is performed
development/test/testbmk.c: chThdWait(chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL));
development/test/testbmk.c: * @p chThdCreateStatic() / @p chThdExit() cycle is performed in each
development/test/testbmk.c: chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL);
development/test/testbmk.c: threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+5, thread3, NULL);
development/test/testbmk.c: threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()+4, thread3, NULL);
development/test/testbmk.c: threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()+3, thread3, NULL);
development/test/testbmk.c: threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()+2, thread3, NULL);
development/test/testbmk.c: threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()+1, thread3, NULL);
development/test/testbmk.c: threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-1, thread8, (void *)&n);
development/test/testbmk.c: threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-1, thread8, (void *)&n);
development/test/testbmk.c: threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-1, thread8, (void *)&n);
development/test/testbmk.c: threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()-1, thread8, (void *)&n);
development/test/testbmk.c: threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()-1, thread8, (void *)&n);
development/wave_analyzer.cpp: chThdCreateStatic(waThreadStack, sizeof(waThreadStack), NORMALPRIO, waThread, (void*) NULL);
egt2can.cpp: chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
hw_layer/board_test.cpp: chThdCreateStatic(btThreadStack, sizeof(btThreadStack), NORMALPRIO, (tfunc_t) ivThread, NULL);
hw_layer/can_hw.cpp: chThdCreateStatic(canTreadStack, sizeof(canTreadStack), NORMALPRIO, (tfunc_t) canThread, NULL);
hw_layer/microsecond_timer.c: chThdCreateStatic(mwThreadStack, sizeof(mwThreadStack), NORMALPRIO, (tfunc_t) mwThread, NULL);
hw_layer/mmc_card.cpp: chThdCreateStatic(mmcThreadStack, sizeof(mmcThreadStack), LOWPRIO, (tfunc_t) MMCmonThread, NULL);
hw_layer/neo6m.cpp: chThdCreateStatic(gpsThreadStack, sizeof(gpsThreadStack), LOWPRIO, GpsThreadEntryPoint, NULL);
hw_layer/stepper.cpp: chThdCreateStatic(stThreadStack, sizeof(stThreadStack), NORMALPRIO, (tfunc_t) stThread, this);