Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #16 (closed defect: fixed)

Opened 9 months ago

Last modified 7 months ago

^C (SIGINT) doesn't interrupt the cocoa runloop

Reported by: lsansonetti@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.2
Component: MacRuby Keywords:
Cc:

Description (last modified by lsansonetti@…) (diff)

Start a MacRuby example, then hit ^C. The program is not interrupted, and still continues, which is not expected.

Manually sending INT using kill(1) produces the same effect.

Change History

Changed 9 months ago by lsansonetti@…

  • description modified (diff)

Changed 9 months ago by lsansonetti@…

  • description modified (diff)

Changed 9 months ago by lsansonetti@…

Changed 9 months ago by lsansonetti@…

Changed 8 months ago by pantarei@…

This is fixed in ruby 1.9 revision 15869.

Changed 7 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacRuby 1.0 to MacRuby 0.2

Should be fixed in trunk, closing.

Changed 7 months ago by z@…

  • status changed from closed to reopened
  • resolution fixed deleted

I just built from trunk revision 202, and C still seems unable to interrupt the run loop.

Changed 7 months ago by z@…

C

Changed 7 months ago by z@…

Bah. SIGINT doesn't interrupt :)

Changed 7 months ago by lsansonetti@…

Indeed, looks like SIGINT doesn't immediately interrupt the runloop, but only during the next runloop iteration. It's still better than before, but it's clearly not fixed yet.

Changed 7 months ago by lsansonetti@…

After a quick investigation, it seems that the signal is intercepted by the default handler but not forwarded to YARV because the runloop blocks the main thread without calling RUBY_VM_CHECK_INTS. This theoretically be fixed if we set up a timer in the main run loop that checks for interruptions.

Changed 7 months ago by lsansonetti@…

  • status changed from reopened to closed
  • resolution set to fixed

Implemented in r212. Periodically calling RUBY_VM_CHECK_INTS every 0.1s. Checked that this is only performed in a CF runloop environment (e.g. not by default) and that the timer has no performance impact (around 0.5% CPU time).

Note: See TracTickets for help on using tickets.