Untitled


SUBMITTED BY: Guest

DATE: Aug. 26, 2013, 2:21 p.m.

FORMAT: Text only

SIZE: 1.8 kB

HITS: 926

  1. /// <summary>
  2. /// Enqeues and exectutes actions synchronously on seperated threads using the <see cref="ThreadPool"/>.
  3. /// </summary>
  4. /// <remarks>
  5. /// Syncronism is guaranteed on a per-instance base in that each enqued action will be executed
  6. /// after the previous action has completed execution for each instance of <see cref="ThreadPoolExectutor" />
  7. /// </remarks>
  8. internal class ThreadPoolExectutor
  9. {
  10. /// <summary>
  11. /// Initializes a new instance of the <see cref="ThreadPoolExectutor"/> class.
  12. /// </summary>
  13. /// <param name="capacity">The absolute (not the initial) number of elements that the <see cref="ThreadPoolExectutor"/> can contain.</param>
  14. public ThreadPoolExectutor(int capacity)
  15. /// <summary>
  16. /// Occurs when exception occured during execution.
  17. /// </summary>
  18. public event EventHandler<ExceptionEventArgs> ExceptionOccurred;
  19. /// <summary>
  20. /// Enqueues a new action with a single parameter for execution on the thread pool.
  21. /// </summary>
  22. /// <param name="action">
  23. /// The action to enqueue for execution.
  24. /// </param>
  25. /// <param name="param">
  26. /// The parameter for the action.
  27. /// </param>
  28. /// <typeparam name="TArg">
  29. /// The type of the <paramref name="param"/>.
  30. /// </typeparam>
  31. public void Execute<TArg>(Action<TArg> action, TArg param)
  32. /// <summary>
  33. /// Enqueues a new action with no parameters for execution on the thread pool.
  34. /// </summary>
  35. /// <param name="action">
  36. /// The action to enqueue for execution.
  37. /// </param>
  38. public void Execute(Action action)
  39. }

comments powered by Disqus