Closed Finomnis closed 11 months ago
Ah, you are entirely right! Will push a fix. (I'm actually amazed anybody uses this crate, it was just a util crate for my hobby OS lol)
Well, it's published and has a catchy name :) async programming on embedded is kinda new, but Rtic 2 is competent based on it. And other sync primitive like Tokio are std. So your crate might experience some more traffic in future.
If this is the case, I would indeed recommend some more tests :) errors like this shouldn't be able to slip through.
Yeah, I'll add tests as soon as I have time (probably this weekend), and publish a new version.
max_readers: 0
together withself.semaphore.acquire(self.max_readers)
means that aquiring awrite
lock is actually a no-op and doesn't perform any locking.Are you sure it shouldn't be this?
Or even simpler:
If this is the case, then I also recommend many more automated tests, so that the confidence in the correctness of this crate is improved.