#477: Need GCD wrapper for dispatch_once ----------------------------------------+----------------------------------- Reporter: ernest.prabha...@… | Owner: lsansone...@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- We need an API for dispatch_once:
http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/dispatch_once.3.html http://developer.apple.com/mac/library/documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html#//apple_ref/c/func/dispatch_once http://www.opensource.apple.com/source/libdispatch/libdispatch-84.5.1/src/once.h http://www.opensource.apple.com/source/libdispatch/libdispatch-84.5.1/src/once.c Ideally something as simple as: Dispatch::Once.new { run_this_once } The tricky part is that the "Once" would have to allocate (the equivalent of) a global or static dispatch_once_t (i.e., a long). Could that be done with class variables? -- Ticket URL: <http://www.macruby.org/trac/ticket/477> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel