RaspberryIO_26/Unosquare.RaspberryIO.Abstractions/IThreading.cs
2019-12-06 22:24:34 +01:00

29 lines
1.0 KiB
C#

using System;
namespace Unosquare.RaspberryIO.Abstractions {
/// <summary>
/// Interface to represent threading methods using interop.
/// </summary>
public interface IThreading {
/// <summary>
/// Starts a new thread of execution which runs concurrently with your main program.
/// </summary>
/// <param name="worker">The thread routine.</param>
void StartThread(Action worker);
/// <summary>
/// Starts a new thread of execution which runs concurrently with your main program.
/// </summary>
/// <param name="worker">The thread routine.</param>
/// <param name="userData">A pointer to the user data.</param>
/// <returns>A pointer to the new thread.</returns>
UIntPtr StartThreadEx(Action<UIntPtr> worker, UIntPtr userData);
/// <summary>
/// Stops the thread pointed at by handle.
/// </summary>
/// <param name="handle">A thread pointer returned by <see cref="StartThreadEx(Action{UIntPtr}, UIntPtr)"/>.</param>
void StopThreadEx(UIntPtr handle);
}
}