If I start a timer in a task on the main thread, say while handling a web request, I can't rearm or stop that timer from a worker task or manually spawned thread.

This is due to a debug assert in libevent2 driver:

debug assert(m_ownerThread is () @trusted { return Thread.getThis(); } ());

(eg. In core/vibe/core/drivers/libevent2.d:483 for version 0.8.2)

From limited testing, my code seems to have no issues in release mode (ie. seemingly the only thing breaking my code are these debug checks).

Are rearm and stop not thread safe? Is the debug statement actually saving me from race conditions/data races, or could they be removed?