melonvpn-original-cs/MelonVPNCore/ThreadWrapper.cs

22 lines
429 B
C#
Raw Permalink Normal View History

2020-09-22 23:10:16 +01:00
using System.Threading;
namespace MelonVPNCore
{
public class ThreadWrapper
{
private Thread wrapper;
public ThreadWrapper(ThreadStart action)
{
wrapper = new Thread(action)
{
IsBackground = true
};
wrapper.Start();
}
public void Join() => wrapper.Join();
public void Kill() => wrapper.Abort();
}
}