Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 68071f884085
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9df54bde9703
Choose a head ref
  • 4 commits
  • 3 files changed
  • 1 contributor

Commits on Feb 9, 2016

  1. Copy the full SHA
    ab2f8e7 View commit details
  2. Copy the full SHA
    df78ec6 View commit details
  3. Copy the full SHA
    7f0543b View commit details
  4. Copy the full SHA
    9df54bd View commit details
Showing with 10 additions and 2 deletions.
  1. +7 −1 core/src/main/java/org/jruby/RubyThread.java
  2. +2 −1 test/mri/excludes/TestThread.rb
  3. +1 −0 test/mri/ruby/test_thread.rb
8 changes: 7 additions & 1 deletion core/src/main/java/org/jruby/RubyThread.java
Original file line number Diff line number Diff line change
@@ -931,6 +931,8 @@ public synchronized IRubyObject thread_variable_get(ThreadContext context, IRuby

@JRubyMethod(name = "thread_variable_set", required = 2)
public synchronized IRubyObject thread_variable_set(ThreadContext context, IRubyObject key, IRubyObject value) {
checkFrozen();

key = getSymbolKey(key);

getThreadLocals(context).put(key, value);
@@ -1000,6 +1002,8 @@ public IRubyObject join(ThreadContext context, IRubyObject[] args) {
RubyThread currentThread = context.getThread();

try {
currentThread.enterSleep();

if (runtime.getThreadService().getCritical()) {
// If the target thread is sleeping or stopped, wake it
synchronized (this) {
@@ -1036,6 +1040,8 @@ public IRubyObject join(ThreadContext context, IRubyObject[] args) {
} catch (ExecutionException ie) {
ie.printStackTrace();
assert false : ie;
} finally {
currentThread.exitSleep();
}

if (exitingException != null) {
@@ -1057,7 +1063,7 @@ public IRubyObject join(ThreadContext context, IRubyObject[] args) {

@JRubyMethod
public IRubyObject value() {
join(NULL_ARRAY);
join(getRuntime().getCurrentContext(), NULL_ARRAY);
synchronized (this) {
return finalResult;
}
3 changes: 2 additions & 1 deletion test/mri/excludes/TestThread.rb
Original file line number Diff line number Diff line change
@@ -2,4 +2,5 @@
exclude(/_stack_size$/, 'often too expensive')
exclude :test_mutex_interrupt, "hangs"
exclude :test_safe_level, "SAFE levels are unsupported"
exclude :test_thread_join_main_thread, "hangs"
exclude :test_thread_join_main_thread, "hangs"
exclude :test_thread_variable_in_enumerator, "fibers in JRuby have their own Thread.current"
1 change: 1 addition & 0 deletions test/mri/ruby/test_thread.rb
Original file line number Diff line number Diff line change
@@ -1053,6 +1053,7 @@ def initialize
def test_thread_name
t = Thread.start {sleep}
assert_nil t.name
Thread.pass until t.stop?
s = t.inspect
t.name = 'foo'
assert_equal 'foo', t.name