Navigation Menu

Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Re-implement MainContext channel around a manual channel
Browse files Browse the repository at this point in the history
This allows us to ensure that dropping the Receiver and its GSource will
also directly drop the closure, instead of having to wait for all
Senders to disappear too.

We have to use a mutex and a shared struct for this, and as such it
makes sense to directly implement the channel as part of this shared
struct. As the std mpsc channel internally also uses mutexes this should
not cause any considerable performance difference.

At the same time also simplify some more code and add a few more tests.

Fixes #454
  • Loading branch information
sdroege committed Feb 18, 2019
1 parent d257b35 commit 3e10da6
Showing 1 changed file with 377 additions and 152 deletions.

0 comments on commit 3e10da6

Please sign in to comment.