Monobjc / monobjc

Git Repository for the Monobjc Project
http://www.monobjc.net/
17 stars 3 forks source link

Add new interop methods to NSThread for invoking delegates. #396

Closed aarononeal closed 11 years ago

aarononeal commented 11 years ago

This change adds convenient methods to invoke an Action delegate with optional parameter either synchronously or asynchronously on a new background thread, the main thread, or a specific thread.

Examples: NSThread.StartNewThread (() => DoSomething()); NSThread.MainThread.Invoke (() => DoSomething()); myThread.Invoke (() => DoSomething());

This commit also removes the redundant and verbose DetachNewThreadSelectorToTargetWithObject overload.

Finally, this commit adds and installs NSThreadSynchronizationContext.