Skip to content

rp2: Make result of thread.get_ident() a non-zero integer. #13413

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

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

projectgus
Copy link
Contributor

@projectgus projectgus commented Jan 11, 2024

Unfortunately this may be a breaking change for any existing rp2 MP code which makes a hard-coded comparison of thread identifier to 0 or 1.

This work was funded through GitHub Sponsors.

CPython says thread identifier is a "nonzero integer", so rp2 should use a
1-indexed core number rather than 0-indexed.  This fixes the
thread/thread_ident1 test failure on rp2 port.

Unfortunately this may be a breaking change for rp2 code which makes a
hard-coded comparison of thread identifier to 0 or 1.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
@dpgeorge dpgeorge force-pushed the bugfix/rp2_thread_ident branch from 1d0335a to bdaea86 Compare January 16, 2024 21:04
@dpgeorge dpgeorge merged commit bdaea86 into micropython:master Jan 16, 2024
@dpgeorge
Copy link
Member

Thank you!

@projectgus projectgus deleted the bugfix/rp2_thread_ident branch November 1, 2024 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants