Commit Graph

12 Commits

Author SHA1 Message Date
John Nunley e0fefc28b1 ex: Remove unsafe code from mutex example
This brings in the try-lock dependency.

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-03 09:49:22 -08:00
John Nunley 68be5281d7 feat: Add stack-based listener
It is instantiated with the listener!() macro.

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-03 09:49:22 -08:00
John Nunley d9144a8a41 feat: Create Listener trait
This commit creates the Listener trait and moves most of EventListener's
functionality to that trait.

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-03 09:49:22 -08:00
John Nunley 86b778074c feat: Move EventListener back onto the heap
Minimal amount of changes to make EventListener a heap-allocated type
again. The existence of the EventListener implies that it is already
listening; accordingly the new() and listen() methods on EventListener
have been removed.

cc #104

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-03 09:49:22 -08:00
John Nunley c278371cfb
feat: Add explicit web support
This commit adds WASM compilation support to this crate. The main thing
is that the wait() family of APIs are removed in WASM mode, as blocking
is not allowed in WASM.

In addition, tests are added to CI to support WASM.

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-26 12:53:39 -07:00
jtnunley e001c7a0c8 Add a type parameter T to Event
Sets up tagged events to use the Notification trait.
2023-04-03 07:37:26 -07:00
jtnunley 996ee4d4f9 EventListener is now used through pinning
The EventListener for the upcoming libstd-based implementation needs to
be pinned, so this commit sets up the infrastructure for the pinned
EventListener.

This is a breaking change.
2023-03-31 13:19:06 -07:00
Stjepan Glavina aba502bf9a Nits 2020-10-09 19:08:39 +02:00
Stjepan Glavina 0dbf5a612a Add Drop impl for Mutex 2020-10-09 19:08:07 +02:00
Stjepan Glavina ecf6ac10e3
Update mutex.rs 2020-08-10 14:01:33 +02:00
Stjepan Glavina 842d1aa118
Update mutex.rs 2020-08-10 13:58:28 +02:00
Stjepan Glavina 049f9a779b Initial commit 2020-05-16 19:44:50 +02:00