Which means, that it is still definitely compiled and linked, not used.
DONT_USE_THR_ALARM is defined when net_serv.cc includes thr_alarm.h, and that means that all those thr_alarm functions become dummy macros. There is one local variable my_bool alarmed=0 is defined, in net_real_read()/net_real_write(), and this local variable checked a couple of times inside thr_alarm_in_use() macro, and that's is it for thr_alarm inside net_serv.cc .
This had been so on mainstream OSes since at least Dec 2009, back when timeouts in vio were handled using socket options. This had improved since, and poll/select is used for timeouts, since this bug was fixed https://bugs.mysql.com/bug.php?id=54790, and
Thus thr_alarm served the only purpose of scaring contributors looking into net_real_read or net_read_write, since 2011-12.
And that for MariaDB only. MySQL , when refactoring network timeout code, in vio, in https://github.com/mysql/mysql-server/commit/dc30732c549b7628b07ff8dbb8d35f0de74a24c9 removed the dummy thr_alarm calls, but we preserved them in merge.
danblack, please review.