[MacRuby-devel] [MacRuby] #796: Dispatch::Queue.main created with a different Queue class?!?
MacRuby
ruby-noreply at macosforge.org
Thu Jul 15 14:28:07 PDT 2010
#796: Dispatch::Queue.main created with a different Queue class?!?
----------------------------------------+-----------------------------------
Reporter: ernest.prabhakar@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: major | Milestone:
Component: MacRuby | Keywords:
----------------------------------------+-----------------------------------
The "Dispatch::Queue.main" fails the equality check in gcd.c, even though
it appears identical.
$ macruby -r dispatch -e 'Dispatch::Job.new {sleep
1}.join(Dispatch::Queue.main) {puts "!"}'
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.2/dispatch/job.rb:28:in
`join:': expected class of [0x2000c1160] to be Dispatch::Queue
[0x20004c8a0], but got Dispatch::Queue [0x2000c1120] (ArgumentError)
from /Users/Shared/MacRuby-trunk/-e:1:in `<main>'
That is, the reported name is the same, but the pointer differs.
Ruby itself seems to think the classes are the same:
$ macruby -r dispatch -e "p Dispatch::Queue.main.class ==
Dispatch::Queue.concurrent.class"
true
Concurrent queues work fine:
$ macruby -r dispatch -e 'Dispatch::Job.new {sleep
1}.join(Dispatch::Queue.concurrent) {puts "!"}'
as do private queues:
$ macruby -r dispatch -e 'Dispatch::Job.new {sleep
1}.join(Dispatch::Queue.new("1")) {puts "!"}'
I don't know if the problems is the class-equality check, or how the main
queue gets a class assigned.
--
Ticket URL: <http://www.macruby.org/trac/ticket/796>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list