Forum: IronRuby Bug - Cannot call CLR constructor of builtin type

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Shri B. (Guest)
on 2009-05-19 23:08
(Received via mailing list)
FYI - http://ironruby.codeplex.com/WorkItem/View.aspx?Wo...

I want to create a CLR Thread and set its AparmentState before calling
Start on it. However, doing System::Threading::Thread.new calls the Ruby
intialize method (since System::Threading::Thread and IronRuby's Thread
map to the same thing) which automatically calls Start. How can I create
an STA thread?

>>> ts = System::Threading::ThreadStart.new { puts "in thread" }
=> System.Threading.ThreadStart
>>> ts.invoke
in thread
=> nil
>>> t = System::Threading::Thread.new ts
:0:in `new': must be called with a block (ThreadError)
from :0

This is the converse case of
http://ironruby.codeplex.com/WorkItem/View.aspx?Wo....
This topic is locked and can not be replied to.