JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-3054

Thread#status is "run" when thread is blocking on condition variable

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 1.2
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      % cat waitcond.rb

      require 'thread'

      mutex = Mutex.new
      cond = ConditionVariable.new

      thread = Thread.new {
      mutex.synchronize

      { cond.wait(mutex) }

      }

      3.times {
      sleep(1)
      puts "thread.status: #

      {thread.status.inspect}

      "
      }

      % jruby --version
      jruby 1.1.4 (ruby 1.8.6 patchlevel 114) (2008-10-12 rev 7874) [i386-java]
      % jruby waitcond.rb
      thread.status: "run"
      thread.status: "run"
      thread.status: "run"
      % ruby --version
      ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin9.4.0]
      % ruby waitcond.rb
      thread.status: "sleep"
      thread.status: "sleep"
      thread.status: "sleep"
      % useruby 1.9
      Activated ruby-1.9.0-r19756
      % ruby --version
      ruby 1.9.0 (2008-10-11 revision 19756) [i386-darwin9.5.0]
      % ruby waitcond.rb
      thread.status: "sleep"
      thread.status: "sleep"
      thread.status: "sleep"

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Fixed in r9103. Specs already existed, so I just enabled some of them.

        Show
        Charles Oliver Nutter added a comment - Fixed in r9103. Specs already existed, so I just enabled some of them.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            James M. Lawrence
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: