Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/tsrb: Make thread-safe [backport 2020.10] #15254

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

maribu
Copy link
Member

@maribu maribu commented Oct 20, 2020

Backport of #15218

Contribution description

Drop the requirement of having only one writer and one reader, as the name of the ring-buffer does not indicate any limitation on the thread-safety. The two-threads-one-buffer kind of ring buffer can be reintroduced with a different name.

Testing procedure

On e.g. STM32 or SAM0 boards, have two threads continuously produce stdio output. The thread with higher priority should sleep for random intervals.

Expected output:

  • The higher priority threads interrupts the lower priority thread and stdio output gets mixed up. But no characters are lost or printed more than once

Actual output:

  • Occasionally, chars get lost or printed more than once

Issues/PRs references

Fixes #9882

Split out of #15103

Drop the requirement of having only one writer and one reader, as the name of
the ring-buffer does not indicate any limitation on the thread-safety. The
two-threads-one-buffer kind of ring buffer can be reintroduced with a different
name.

(cherry picked from commit 0d0b14d)
@maribu maribu added Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Oct 20, 2020
@maribu maribu requested a review from miri64 October 20, 2020 18:39
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change is identical to #15218

@miri64 miri64 merged commit 71b7839 into RIOT-OS:2020.10-branch Oct 21, 2020
@maribu maribu deleted the backport/2020.10/tsrb-fix branch May 27, 2022 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants