Skip to content
Snippets Groups Projects
Commit 74fddbc0 authored by Andy Green's avatar Andy Green
Browse files

cancel_service: change to event-loop agnostic implementation

 - Add platform helpers for pipe creation.

 - Change the direct-to-fds implementation to create a wsi for each
   pt and use the normal apis to bind it to the event loop.

 - Modifiy context creation and destroy to create and remove the
   event pipe wsis.

 - Create the event pipe wsis during context create if using the
   default poll() event loop, or when the other event loops start
   otherwise.

 - Add handler that calls back user code with
   LWS_CALLBACK_EVENT_WAIT_CANCELLED

This patch allows you to call `lws_cancel_service(struct lws_context *context)`
from another thread.

It's very cheap for the other thread to call and is safe without
locking.

Every use protocol receives a LWS_CALLBACK_EVENT_WAIT_CANCELLED from
the main thread serialized normally in the event loop.
parent 97cd3936
No related branches found
No related tags found
No related merge requests found
Showing with 384 additions and 192 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment