Closed lukego closed 6 years ago
I think because it's mainly just a thin wrapper around libuv's uv_loop_close
/uv_stop
, and libuv is only threadsafe when using notifiers, I'd guess that it's not safe to call from another thread.
In this case, I'd check out https://orthecreedence.github.io/cl-async/notifiers. It's an extra step, but won't give you segfaults at random times =].
Thanks! Yes that's the approach that I'm taking. It's working out very neatly to push work onto the event loop using mailboxes and notifiers. 👍
I am not sure from the documentation whether
AC:EXIT-EVENT-LOOP
can be called from any thread or whether it has to be called from within the event loop?I am assuming that it has to be called from within the event loop because I don't see any obvious synchronization code to prevent a race condition leading to double-free. If it can indeed be safely called from any thread that would be handy to know though because then I could simplify my shutdown code.