Commit Graph

46 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 06be5ee5c9 Event
- Documented module
2023-06-12 08:26:33 +02:00
Tristan B. Velloza Kildaire 37a971654f SnoozeError
- Documented the `SnoozeError` class and constructor
2023-06-10 14:41:25 +02:00
Tristan B. Velloza Kildaire cd26c0c0d4 Exceptions
- Documented module
2023-06-10 14:40:29 +02:00
Tristan B. Velloza Kildaire 0763bc03dd Exceptions
- Only allow the `libsnooze` package to construct a `SnoozeError`
2023-06-10 14:39:21 +02:00
Tristan B. Velloza Kildaire 9add909256 Package
- Documented the module `libsnooze` and the public imports
2023-06-10 14:32:18 +02:00
Tristan B. Velloza Kildaire caffd5f041 Event
- Added TODO where fix is needed
2023-06-08 22:18:50 +02:00
Tristan B. Velloza Kildaire b9d77b3a21 Event
- Added TODO
2023-04-07 13:29:36 +02:00
Tristan B. Velloza Kildaire 60fb29a875
Update README.md 2023-03-25 22:45:32 +02:00
Tristan B. Velloza Kildaire 64d70c635f
Create d.yml 2023-03-25 22:44:01 +02:00
Tristan B. Velloza Kildaire 7ac6bc8622 - Explained how to get `libsnooze` properly imported and building in your project 2023-03-19 13:18:10 +02:00
Tristan B. Velloza Kildaire e6b0b57ceb - Rolled back breaking changes 2023-03-19 13:17:02 +02:00
Tristan B. Velloza Kildaire caa8ee9376 Package
- Mixin hack to get unit tests and client-side library usage working - but not OUR builds
2023-03-19 13:14:46 +02:00
Tristan B. Velloza Kildaire e8ae7e67b3 Event
- Testing new import mechanism to fix build and unit test issues

Package

- Testing new import mechanism
2023-03-19 13:09:45 +02:00
Tristan B. Velloza Kildaire 22964a3178 Event
- Added new method `ensure()` which ensures that the calling thread gets a registered pipe pair added for it when called.
- This can be useful if one wants to initialize several threads that should be able to all be notified and wake up on their first call to wait instead of having wait ensure the pipe is created on first call
- Typo fix in comment in `wait(timeval*)`
- Implemented (not yet tested) `wouldWait()` which returns `true` if you would block if you called `wait()`, `false` otherwise
2023-03-10 18:56:24 +02:00
Tristan B. Velloza Kildaire 0328a80bd5 Event
- Removed now-completed TODO
2023-03-03 17:20:06 +02:00
Tristan B. Velloza Kildaire d57a214e99 Event
- Fixed indentation
2023-03-03 17:19:39 +02:00
Tristan B. Velloza Kildaire 15c83d32b5 - Pushed into `else` compiler directive 2023-02-26 22:32:37 +02:00
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