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

WIP: CFE-4401: Adjusted use of pthreads for Android/Termux platform #5574

Closed
wants to merge 1 commit into from

Conversation

craigcomstock
Copy link
Contributor

Android/Termux doesn't have pthread_cancel so use pthred_kill instead

Ticket: CFE-4401
Changelog: title

Android/Termux doesn't have pthread_cancel so use pthred_kill instead

Ticket: CFE-4401
Changelog: title
(cherry picked from commit ebd52a29238122c4bcc2f86d2313f9f4a258243c)
ret = pthread_cancel(thread_data.thread);
#else
ret = pthread_kill(thread_data.thread, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to join a "killed" thread? Will this call the signal handler installed by the agent. If so, is this fine? Also the man pthread_kill(3) says:

If sig is 0, then no signal is sent, but error checking is still performed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should read your blog post, man pages and then try out isreadable() and see how it goes on termux. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like there is already a patch in termux-packages we may be able to pull in.

https://github.com/termux/termux-packages/blob/master/packages/cfengine/pthread_cancel.patch

@craigcomstock craigcomstock marked this pull request as draft July 9, 2024 21:01
@craigcomstock craigcomstock added the WIP Work in Progress label Jul 10, 2024
@craigcomstock craigcomstock changed the title CFE-4401: Adjusted use of pthreads for Android/Termux platform WIP: CFE-4401: Adjusted use of pthreads for Android/Termux platform Jul 10, 2024
@craigcomstock
Copy link
Contributor Author

There is a fix in termux-packages already for this issue. I will read Lars' blog and the termux-packages patch and see where we want to go with a fix here in core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in Progress
2 participants