'Thread.main.exit!' and/or 'Kernel.exit!' does not work under certain 
circumstances 
------------------------------------------------------------------------------------

                 Key: JRUBY-1286
                 URL: http://jira.codehaus.org/browse/JRUBY-1286
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.0.0, JRuby 1.1.0
         Environment: Linux
            Reporter: Martin Krauskopf


I'm trying to solve problem why classic debugger in debug-commons does not exit 
under Windows. It is caused by the fact that 'Kernel.exit!' does not exit the 
underlaying process. As trying to reproduce with simple test-case I've got to 
the following one under Linux which might be related to the Windows problem. 
Not sure, the one under Windows might be different.

Following code exit under C Ruby but not under JRuby (running Linux). It might 
cause by the 'next' call somehow (?).

{code} 
terminator = Thread.new do
  sleep 2
  puts 'exit'
  exit!
end
Kernel.module_eval(<<-"end;"
      alias_method(:debug_commons_set_trace_func, :set_trace_func)
      def set_trace_func(proc)
        raise "Cannot call 'set_trace_func' method during debugging session."
      end
  end;
)
debug_commons_set_trace_func(lambda do |_, _, _, _, _, _|
  next if Thread.current == terminator
  loop do
    puts Thread.current.object_id
    sleep 1
  end
end)
p "whatever...."
{code} 


-- 
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

Reply via email to