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

Allow Android builds with systhreads #6624

Closed
vicuna opened this Issue Oct 22, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

commented Oct 22, 2014

Original bug ID: 6624
Reporter: @whitequark
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:47:13Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)

Bug description

Android lacks declarations for pthread_cancel and pthread_atfork, the reasons and workarounds for which are provided in the attached patch.

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 22, 2014

Comment author: @gasche

My (weak) understanding is that your patch completely silences st_thread_kill on Android. How does that not cause trouble further down? The only use of st_thread_kill I see is in caml_thread_cleanup, which is called by caml_thread_stop and also exposed as an external primitive.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 22, 2014

Comment author: @whitequark

The point is a bit moot, because Android simply does not have any way to do what st_thread_kill does. On a second thought I probably should raise some exception inside st_thread_kill instead (there is simply no way to actually kill the thread on Android, and using Thread.kill is extremely bad design anyway). Do you know which one?

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 22, 2014

Comment author: @whitequark

By the way, I think a note should be added to Thread.kill elaborating why it should not be used. If you need further convincing, this page provides a very detailed description of the reasons behind it: http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 13, 2014

Comment author: @gasche

Merged in trunk.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 15, 2015

Comment author: @gasche

This is also included in branch 4.02 as commit 15708.

@vicuna vicuna closed this Dec 7, 2016

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.