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: 0628437a7354
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: eed16e9cb907
Choose a head ref
  • 2 commits
  • 15 files changed
  • 1 contributor

Commits on Oct 10, 2015

  1. Copy the full SHA
    115aadd View commit details
  2. Copy the full SHA
    eed16e9 View commit details
10 changes: 0 additions & 10 deletions spec/truffle/tags/core/thread/alive_tags.txt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fails:Thread::Backtrace::Location#path outside a main script returns an absolute path
fails:Thread::Backtrace::Location#path in a main script when the script is in the working directory when using a relative script path returns a path relative to the working directory
fails:Thread::Backtrace::Location#path in a main script when the script is in the working directory when using an absolute script path returns an absolute path
fails:Thread::Backtrace::Location#path in a main script when the script is in a sub directory of the working directory when using a relative script path returns a path relative to the working directory
fails:Thread::Backtrace::Location#path in a main script when the script is in a sub directory of the working directory when using an absolute script path returns an absolute path
fails:Thread::Backtrace::Location#path in a main script when the script is outside of the working directory when using a relative script path returns a path relative to the working directory
fails:Thread::Backtrace::Location#path in a main script when the script is outside of the working directory when using an absolute path returns an absolute path

This file was deleted.

8 changes: 0 additions & 8 deletions spec/truffle/tags/core/thread/inspect_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/thread/list_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/thread/new_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
fails:Thread.new raises an exception when not given a block
fails:Thread.new creates a subclass of thread calls super with a block in initialize
fails:Thread.new calls #initialize and raises an error if super not used
fails:Thread.new calls and respects #initialize for the block to use
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/thread/raise_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/thread/set_trace_func_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/thread/start_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
fails:Thread.start Thread.start raises an ArgumentError if not passed a block
fails:Thread.start Thread.start spawns a new Thread running the block
fails:Thread.start Thread.start respects Thread subclasses
fails:Thread.start Thread.start does not call #initialize
8 changes: 0 additions & 8 deletions spec/truffle/tags/core/thread/status_tags.txt

This file was deleted.

10 changes: 0 additions & 10 deletions spec/truffle/tags/core/thread/stop_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1835,7 +1835,7 @@ private long doSleepMillis(final long durationInMillis) {

// Clear the wakeUp flag, following Ruby semantics:
// it should only be considered if we are inside the sleep when Thread#{run,wakeup} is called.
Layouts.THREAD.getWakeUp(thread).getAndSet(false);
Layouts.THREAD.getWakeUp(thread).set(false);

return sleepFor(this, getContext(), durationInMillis);
}
Original file line number Diff line number Diff line change
@@ -210,7 +210,7 @@ public long doSleepMillis(DynamicObject mutex, long durationInMillis) {
// Here we do it before unlocking for providing nice semantics for
// thread1: mutex.sleep
// thread2: mutex.synchronize { <ensured that thread1 is sleeping and thread1.wakeup will wake it up> }
Layouts.THREAD.getWakeUp(thread).getAndSet(false);
Layouts.THREAD.getWakeUp(thread).set(false);

UnlockNode.unlock(lock, thread, this);
try {
9 changes: 9 additions & 0 deletions truffle/src/main/ruby/core/rubinius/bootstrap/thread.rb
Original file line number Diff line number Diff line change
@@ -50,6 +50,15 @@ def priority=(val)
Kernel.raise ThreadError, "Thread#priority= primitive failed"
end

def inspect
stat = status()
stat = "dead" unless stat

"#<#{self.class}:0x#{object_id.to_s(16)} id=#{@thread_id} #{stat}>"
end

alias_method :to_s, :inspect

def self.exit
Thread.current.kill
end