[Libwebsockets] signal handlers not async-safe

Andy Green andy at warmcat.com
Wed Apr 21 20:49:27 CEST 2021

On 4/21/21 5:27 PM, Phil wrote:
> Hi
> Just wanted to point out that functions called from a signal handler are supposed to be "async-safe".
> That means write is ok, but not exit or fprintf.
If you have a specific instance in mind you feel I should do something 
about, can you point to it?  Generally in the examples, we're only using 
SIGINT, setting a flag and picking up on it in the event loop.

> Also wondering whether C11 or C++11 threads on all platforms would be simpler than relying on a pthreads layer for Windows.

Well, this builds on pretty much any crappy embedded toolchain as it is.

pthreads seems to work well on Windows, why do I want to redo that?


More information about the Libwebsockets mailing list