Files
mirror-processhacker/trunk/ProcessHacker.Native/Threading/CurrentThread.cs
T
wj32 28d89099c6 * added timer properties
* refactored handle code
* fixed time bugs in handle code
* added wrapper synchronization object classes

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1347 21ef857c-d57f-4fe0-8362-d861dc6d29cd
2009-05-30 05:26:35 +00:00

48 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using ProcessHacker.Native.Objects;
namespace ProcessHacker.Native.Threading
{
/// <summary>
/// Provides methods for manipulating the current thread.
/// </summary>
public static class CurrentThread
{
/// <summary>
/// Switches to another thread.
/// </summary>
public static void Sleep()
{
Yield();
}
/// <summary>
/// Suspends execution of the current thread.
/// </summary>
/// <param name="interval">The interval to sleep, in milliseconds.</param>
public static void Sleep(int interval)
{
ThreadHandle.Sleep(interval, true);
}
/// <summary>
/// Suspends execution of the current thread.
/// </summary>
/// <param name="time">The time at which wake up.</param>
public static void Sleep(DateTime time)
{
ThreadHandle.Sleep(time.ToFileTime(), false);
}
/// <summary>
/// Switches to another thread.
/// </summary>
public static void Yield()
{
ThreadHandle.Yield();
}
}
}