Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ jobs:
export PKG_CONFIG_PATH="$PWD/inst/lib/pkgconfig"
pkg-config --exists protothread
echo "version: $(pkg-config --modversion protothread)"
test "$(pkg-config --modversion protothread)" = "2.0.0"
test "$(pkg-config --modversion protothread)" = "2.1.0"
printf '#include "protothread.h"\nint main(void){struct protothread_s s;protothread_init(&s);return protothread_run(&s);}\n' > use.c
gcc $(pkg-config --cflags protothread) use.c -o use $(pkg-config --libs protothread)
./use
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.1.0] - 2026-10-15

### Added

- `pt_wait_until(c, channel, cond)`, which tests the predicate and enqueues in
Expand All @@ -22,7 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
before `pt_kill()`ing or freeing one that might be using the lock, as
`pt_timer_cancel()` is for one that might be sleeping. Without it such a kill
left the lock granted to a dead thread and never released.

- `protothread_queue.h`: message queues, what Go calls channels. A queue is a
fixed-capacity ring buffer in storage the caller supplies, so it needs no
allocator, and `PT_QUEUE_DEFINE(name, type)` makes it type-safe; `pt_queue_t`
Expand All @@ -47,6 +48,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the lock can tell a live request from a finished one. Internal, but it means
a `pt_lock_env_t` must be zeroed or have been used with that lock before
`pt_lock_cancel()` is called on it.
- The README's sections on semaphores, timers, locks, and queues moved to
their own pages under `doc/`, and the rest of the README was edited for
readability.

## [2.0.0] - 2026-09-22

Expand Down Expand Up @@ -170,4 +174,6 @@ There were no tagged releases before 2.0.0. The earlier code, which CMake and
pkg-config reported as version 1.0 regardless of what changed, is referred to
here as 1.x.

[Unreleased]: https://github.com/LarryRuane/protothread/compare/v2.1.0...HEAD
[2.1.0]: https://github.com/LarryRuane/protothread/releases/tag/v2.1.0
[2.0.0]: https://github.com/LarryRuane/protothread/releases/tag/v2.0.0
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@ This project uses [semantic versioning](https://semver.org). The version lives i

```c
#define PT_VERSION_MAJOR 2
#define PT_VERSION_MINOR 0
#define PT_VERSION_MINOR 1
#define PT_VERSION_PATCH 0
#define PT_VERSION_NUMBER /* ordered: 20000 */
#define PT_VERSION_STRING /* "2.0.0", derived from the numbers */
#define PT_VERSION_NUMBER /* ordered: 20100 */
#define PT_VERSION_STRING /* "2.1.0", derived from the numbers */
#define PT_VERSION_AT_LEAST(major, minor, patch)
```

Expand Down
8 changes: 3 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ argument actually bites.

## More synchronization primitives ##

Timers are done (`protothread_timer.h`). Remaining, most useful first:
Timers (`protothread_timer.h`) and message queues (`protothread_queue.h`, in
2.1.0) are done. Remaining, most useful first:

* **Message queue.** The most-used RTOS primitive in practice, and it would
replace the hand-rolled single-slot mailbox in the README's own example.
Bounded ring over a caller-supplied buffer, blocking put/get, no allocation.
* **Event flags.** Wait for any or all of a bit mask. Pairs well with
interrupt handlers, and is the cheap workaround for the lack of multi-wait.
* **Wait with timeout.** Needs the pattern the reader-writer lock already
Expand Down Expand Up @@ -147,7 +145,7 @@ debugging into a one-line call, and costs nothing in a production build.

* ~~Continuous integration~~ -- done, `.github/workflows/ci.yml`. Its first
run found that the library did not build under clang at all.
* ~~Tag a release~~ -- done, `v2.0.0`.
* ~~Tag a release~~ -- done, `v2.0.0`, then `v2.1.0`.
* ~~Document that `pt_wait`/`pt_signal` *is* a condition variable~~ -- done,
the "Wait channels" section of README.md, which also makes the case for the
interface: it is universal, and it degenerates to a busy-wait loop you can
Expand Down
2 changes: 1 addition & 1 deletion protothread.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
* #endif
*/
#define PT_VERSION_MAJOR 2
#define PT_VERSION_MINOR 0
#define PT_VERSION_MINOR 1
#define PT_VERSION_PATCH 0

#define PT_VERSION_NUMBER \
Expand Down
Loading