2019-12-06 22:24:34 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Unosquare.RaspberryIO.Abstractions {
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface to represent threading methods using interop.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IThreading {
|
2019-12-04 18:57:18 +01:00
|
|
|
|
/// <summary>
|
2019-12-06 22:24:34 +01:00
|
|
|
|
/// Starts a new thread of execution which runs concurrently with your main program.
|
2019-12-04 18:57:18 +01:00
|
|
|
|
/// </summary>
|
2019-12-06 22:24:34 +01:00
|
|
|
|
/// <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);
|
|
|
|
|
}
|
2019-12-04 18:57:18 +01:00
|
|
|
|
}
|