var workerSemphore = new Semaphore(0, 800000);
var IsWorkThreadCreated = true;
var workThread = new Thread(() =>
{
Console.WriteLine("XiaoweiSDK.CreateWorkerThread created!");
while (IsWorkThreadCreated)
{
//Debug.WriteLine("lock wait:XiaoweiSDK::CreateWorkerThread");
workerSemphore.WaitOne();
//Debug.WriteLine("lock enter:XiaoweiSDK::CreateWorkerThread");
Console.WriteLine("------------XiaoweiSDK.CreateWorkerThread inside inside inside!");
}
Console.WriteLine("XiaoweiSDK.WorkerThread exited!");
});
workThread.IsBackground = true;
workThread.Start();
Console.WriteLine("XiaoweiSDK.WorkerThread Release111111111!");
workerSemphore.Release();
Console.WriteLine("XiaoweiSDK.WorkerThread Release2222222222");
workerSemphore.Release();