Queues a method for execution. The method executes when a thread pool thread becomes available.

C# | Visual Basic | Visual C++ | J# |
public static bool QueueUserWorkItem( WaitCallback callback, Object state )
Public Shared Function QueueUserWorkItem ( _ callback As WaitCallback, _ state As Object _ ) As Boolean
public: static bool QueueUserWorkItem( WaitCallback^ callback, Object^ state )
public static boolean QueueUserWorkItem( WaitCallback callback, Object state )

- callback (WaitCallback)
- A System.Threading.WaitCallback that represents the method to be executed.
- state (Object)
- An object containing data to be used by the method.

true if the method is successfully queued; System.OutOfMemoryException is thrown if the work item could not be queued.