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

Commits on Jul 23, 2015

  1. [Truffle] 2**63-1 ms is more than enough.

    * It is about 292 471 208 years.
    eregon committed Jul 23, 2015
    Copy the full SHA
    c7acd56 View commit details
  2. Make sure the thread is actually waiting in ConditionVariable specs

    * The thread can also have the status "sleep" very shortly when calling Mutex#lock.
    eregon committed Jul 23, 2015
    Copy the full SHA
    acb9129 View commit details
7 changes: 6 additions & 1 deletion spec/ruby/library/conditionvariable/signal_spec.rb
Original file line number Diff line number Diff line change
@@ -10,13 +10,18 @@
it "returns self if something is waiting for a signal" do
m = Mutex.new
cv = ConditionVariable.new
in_synchronize = false

th = Thread.new do
m.synchronize do
in_synchronize = true
cv.wait(m)
end
end

# ensures that th grabs m before current thread
# wait for m to acquire the mutex
Thread.pass until in_synchronize
# wait until th is sleeping (ie waiting)
Thread.pass while th.status and th.status != "sleep"

m.synchronize { cv.signal }.should == cv
Original file line number Diff line number Diff line change
@@ -1773,7 +1773,6 @@ public SleepNode(RubyContext context, SourceSection sourceSection) {

@Specialization
public long sleep(NotProvided duration) {
// TODO: this should actually be "forever".
return doSleepMillis(Long.MAX_VALUE);
}

Original file line number Diff line number Diff line change
@@ -198,8 +198,7 @@ public SleepNode(RubyContext context, SourceSection sourceSection) {

@Specialization
public long sleep(RubyBasicObject mutex, NotProvided duration) {
// TODO: this should actually be "forever".
return doSleepMillis(mutex, Integer.MAX_VALUE);
return doSleepMillis(mutex, Long.MAX_VALUE);
}

@Specialization(guards = "isNil(duration)")