Skip to content

Wrap Process.wait* calls with pthread_kill logic.#5848

Merged
headius merged 1 commit intojruby:masterfrom
headius:pthread_kill_waits
Aug 29, 2019
Merged

Wrap Process.wait* calls with pthread_kill logic.#5848
headius merged 1 commit intojruby:masterfrom
headius:pthread_kill_waits

Conversation

@headius
Copy link
Member

@headius headius commented Aug 27, 2019

This addresses #1050 in the same way CRuby implements this. In
CRuby, the wait functions are called directly, and the
pthread_kill function is used to force the call to be
interrupted. It turns out the JVM also uses pthread_kill to
interrupt blocking native calls, so we use the same binding they
do.

Note that this will only be used on non-Windows, but the JDK's
binding of NativeThread.signal might already be stubbed out
there.

This addresses jruby#1050 in the same way CRuby implements this. In
CRuby, the wait functions are called directly, and the
`pthread_kill` function is used to force the call to be
interrupted. It turns out the JVM also uses `pthread_kill` to
interrupt blocking native calls, so we use the same binding they
do.

Note that this will only be used on non-Windows, but the JDK's
binding of `NativeThread.signal` might already be stubbed out
there.
@headius headius force-pushed the pthread_kill_waits branch from 6cc6f27 to 792f5f6 Compare August 27, 2019 06:33
@headius headius requested a review from enebo August 29, 2019 20:16
@headius
Copy link
Member Author

headius commented Aug 29, 2019

@enebo Any concerns here?

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.

1 participant