Projects

Ticket #179 (closed defect: fixed)

Opened 3 years ago

Last modified 23 months ago

Calling Regexp#match from ObjC in a background thread hangs

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

Description

Calling this from a foreground thread works fine, but if I call Regexp#match from ObjC in a background thread, it hangs. Attaching example.

Attachments

RegexpTest.zip Download (32.1 KB) - added by tjw@… 3 years ago.
Xcode project demonstrating the problem.

Change History

Changed 3 years ago by tjw@…

Xcode project demonstrating the problem.

Changed 3 years ago by tjw@…

  • cc tjw@… added

Cc Me!

Changed 23 months ago by lsansonetti@…

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

The problem seems to be fixed in trunk as of r3858. This version of MacRuby features thread-safe regexps.

I had to change the sample code though to use performRubySelector: though. Calling some Ruby selectors that have negative arities (like #match) using the ObjC ABI does not work.

    id match = [regex performRubySelector:@selector(match:) withArguments: line, NULL];
Note: See TracTickets for help on using tickets.