Skip to content

Fix absence of pthread_cancel in Android #1582

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 2 commits into from
Apr 10, 2025

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented Apr 9, 2025

This PR fixes a build error on Android because pthread_cancel is not implemented in Bionic, the library Google uses for Android that implements parts of C like pthread (thanks to @sogaiu for bringing this to my attention). This PR uses signals for Android as a workaround.

@bakpakin
Copy link
Member

Looks good to me. As far as pthread_cancel, this is why Janet doesn't really support canceling threads in the first place, as it is difficult to coordinate with threads and make sure that clean up code gets run, such as decrementing refcounts.

@bakpakin bakpakin merged commit 5ebe945 into janet-lang:master Apr 10, 2025
13 checks passed
@pyrmont pyrmont deleted the bugfix.termux-pthread_cancel branch April 11, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants