Commit Graph

29 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 00d18e0800 - Test more 2023-02-26 22:31:04 +02:00
Tristan B. Velloza Kildaire ddd6cb1275 - Trying to fix this broken importC (jeese)
-
2023-02-26 22:22:11 +02:00
Tristan B. Velloza Kildaire 9592c615bf - Trying to fix the imports with the C-related code (ImportC-related) 2023-02-26 22:05:26 +02:00
Tristan B. Velloza Kildaire e983928442 Try new dub thing 2023-02-26 21:54:08 +02:00
Tristan B. Velloza Kildaire f383548497 Event
- Added missing documentation
2023-02-26 17:54:41 +02:00
Tristan B. Velloza Kildaire 8225c9e450 Event
- Removed now-completed TODOs
2023-02-26 17:53:14 +02:00
Tristan B. Velloza Kildaire e809f37b9a
Update README.md 2023-02-26 17:51:46 +02:00
Tristan B. Velloza Kildaire a3dcb3517c Clib
- CLeaned up

Event

- Fixed bug whereby a timeout of `0` would cause issues with our `status` logic that examined the returned value from `select(fd_set*, fd_set*, fd_set*, timeval)`
2023-02-26 17:50:08 +02:00
Tristan B. Velloza Kildaire 593f7f44db Event
- `wait(timeval)` will now throw a `SnoozeError` when the `select(fd*, fd*, fd*, timeval)` returns `-1`
2023-02-26 17:31:39 +02:00
Tristan B. Velloza Kildaire 00ea389d4a Event
- Calling `wait(timeval)` will now throw a `SnoozeError` if the call to `read(int, void*, int)` fails (returns something other than the expected `1`-byte count)
2023-02-26 17:21:52 +02:00
Tristan B. Velloza Kildaire 24f0d69bc0 Event
- Added notice about something I would like to have fixed
2023-02-26 17:09:01 +02:00
Tristan B. Velloza Kildaire 7a69537ebe Unit tests
- Added a unit test for timeouts
2023-02-26 17:06:01 +02:00
Tristan B. Velloza Kildaire ee745a4db6 Unit tests
- Recfatored imports for unit tests into a single block
2023-02-26 17:04:02 +02:00
Tristan B. Velloza Kildaire c4cf6f73dd Event
- Re-enabled imports
2023-02-26 17:01:27 +02:00
Tristan B. Velloza Kildaire 2c0f7f9292 C-linking
- Found a work-around to get it building
2023-02-26 16:58:39 +02:00
Tristan B. Velloza Kildaire 220b8d3df0 Event
- Added missing import back to unit tests
2023-02-25 16:27:09 +02:00
Tristan B. Velloza Kildaire cfef7f8abd Unit tests
- Removed uneeded imports inside the unit tests
2023-02-25 16:26:13 +02:00
Tristan B. Velloza Kildaire b82fb40f6f clib
- Added an import for the `select(...)` function
- Added wrapper functions which handle the `FD_ZERO` and `FD_SET` macros which ImportC cannot refer to directly

Event

- Cleaned up imports
- `wait()` now calls `wait(Duration)` with a duration of `0`
- Implemented a wait with a timeout, `wait(Duration)` which returns `true` if not timed out and `false` on timeout
-  Implemented the underlying `select(...)`-based `wait(Duration)` inside of `wait(timeval)`
2023-02-25 16:24:56 +02:00
Tristan B. Velloza Kildaire 7ecac9e4cb Event
- Ensure that whenever you try to construct an `Event` object on windows that it will cause a runtime error
- Renamed the old `notify()` to `notifyAll()`
- Implemented `notify(Thread)` which will wake up an individual thread which is waiting on the event, if the thread never await'd the event atleast hen an error is thrown (this will be made configurable soon)
- Added a `nonFail` boolean (not yet fully implemented - see issue #2) which will allow us to not throw an exception when the thread is not in the store
- The new `notifyAll()` now uses `notify(Thread)` internally

Unit tests

- Updated the first unit test to wait for the threads to both end
- Added a second unit test which tests notifying a `Thread` which never awit'd the `Event` atleast once
2023-02-24 21:24:17 +02:00
Tristan B. Velloza Kildaire 63227703c3 Event
- Changed method `notify()` to `notifyAll()`

Documentation

- Updated example usage
2023-02-23 16:01:03 +02:00
Tristan B. Velloza Kildaire eeab29d54e - Added license 2023-02-23 15:47:46 +02:00
Tristan B. Velloza Kildaire 21e838e3b2 - Fixed formatting
- Added tagline
2023-02-23 15:41:51 +02:00
Tristan B. Velloza Kildaire e73cb325b6 - Added example usage 2023-02-23 15:38:55 +02:00
Tristan B. Velloza Kildaire 7579b9bd42 - Resized logo in README 2023-02-23 15:36:34 +02:00
Tristan B. Velloza Kildaire 250a060420 - Fixed formatting in README 2023-02-23 15:31:59 +02:00
Tristan B. Velloza Kildaire 8c871dfd13 - Updated README 2023-02-23 15:29:56 +02:00
Tristan B. Velloza Kildaire cb8f199aab - Added logo
- Added readme
2023-02-23 15:27:49 +02:00
Tristan B. Velloza Kildaire 89dadcad04 - Refactored into a package 2023-02-23 15:21:54 +02:00
Tristan B. Velloza Kildaire 198c987031 Initial implementation 2023-02-23 15:16:24 +02:00