Skip to content

Add EventsLoop::wakeup independent of interrupt #175

@jwilm

Description

@jwilm

The method EventsLoop::interrupt() is currently serving the dual purpose of

  1. Stop processing events during run_forever and poll_events
  2. Wakeup the event loop from other threads

Running the wakeup code when you only care about 1. simply wastes cycles.

I'm proposing that a second method, EventsLoop::wakeup() is added to allow performing these tasks independently. An alternative design would be removing the interrupted flag altogether and allow the closure passed to run_forever and poll_events to return a flag indicating their desire to continue or halt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions