Undefined method exclusive for Thread class
-------------------------------------------
Key: JRUBY-4154
URL: http://jira.codehaus.org/browse/JRUBY-4154
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.4.0RC2
Environment: osx
Reporter: McClain Looney
While writing some middleware, installing Rack::Reloader will break the
application thusly:
The relevant code in reloader (line 35 is the call to Thread.exclusive()):
def call(env)
if @cooldown and Time.now > @last + @cooldown
if Thread.list.size > 1
Thread.exclusive{ reload! }
else
reload!
end
@last = Time.now
end
@app.call(env)
end
=> Booting WEBrick
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2009-10-23 23:47:56] INFO WEBrick 1.3.1
[2009-10-23 23:47:56] INFO ruby 1.8.7 (2009-10-21) [java]
[2009-10-23 23:47:56] INFO WEBrick::HTTPServer#start: pid=71432 port=3000
[2009-10-23 23:48:00] ERROR NoMethodError: undefined method `exclusive' for
Thread:Class
/Users/mml/.gem/jruby/1.8/gems/rack-1.0.1/lib/rack/reloader.rb:35:in
`call'
/Users/mml/.gem/jruby/1.8/gems/rails-2.3.4/lib/rails/rack/static.rb:31:in `call'
/Users/mml/.gem/jruby/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:48:in
`call'
/Users/mml/.gem/jruby/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in
`each'
/Users/mml/.gem/jruby/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in
`call'
/Users/mml/.gem/jruby/1.8/gems/rails-2.3.4/lib/rails/rack/log_tailer.rb:17:in
`call'
/Users/mml/.gem/jruby/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in
`call'
/Users/mml/.gem/jruby/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in
`service'
/opt/local/jruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/opt/local/jruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
/opt/local/jruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
/Users/mml/.gem/jruby/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:14:in
`run'
/Users/mml/.gem/jruby/1.8/gems/rails-2.3.4/lib/commands/server.rb:111
/Users/mml/.gem/jruby/1.8/gems/rails-2.3.4/lib/commands/server.rb:31:in
`require'
/opt/local/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/Users/mml/work/kinetic/kr/script/server:3
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email