Laurent Sansonetti
lsans****@apple*****
Thu Jul 5 18:39:43 JST 2007
On Jul 5, 2007, at 11:10 AM, Satoshi Nakagawa wrote: >> So I would say that the safest way to do threading with RubyCocoa is >> to use the patch and Ruby threads (via the Thread class). > > It's ok. > But I want to support Tiger + ruby 1.8.2 on my application. > So I think I should use > performSelectorOnMainThread_withObject_waitUntilDone > for a while. 2 things you could do: - Only set the RUBYCOCOA_THREAD_HOOK_DISABLE environment variable if OSX::RBRuntime.isRubyThreadingSupported? returns false. Note that this method is new in trunk. One possible way: unless ((OSX::RBRuntime.isRubyThreadingSupported?) rescue false) ENV['RUBYCOCOA_THREAD_HOOK_DISABLE'] = true end - Embed the patched Ruby inside your application (actually, libruby.dylib, the standard library and the extensions should be enough). Laurent