Skip to content

Commit

Permalink
working on threading
Browse files Browse the repository at this point in the history
  • Loading branch information
clearosdev_cp authored and clearosdev_cp committed Aug 2, 2013
1 parent 203b923 commit f125cbc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/Cosmos/Cosmos.Kernel.Plugs/ThreadImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Cosmos.Kernel.Plugs {
[Plug(Target=typeof(System.Threading.Thread))]
public static class ThreadImpl {
private bool running = true;

public static IntPtr InternalGetCurrentThread() {
return IntPtr.Zero;

Expand All @@ -15,6 +17,22 @@ public static void Sleep(int millisecondsTimeout)
//Cosmos.Hardware.Global.Sleep((uint) millisecondsTimeout);
Kernel.CPU.Halt();
}
public static void Start()
{
if (SetMethod == null)
throw new Exception("SetMethod can't equal null");

do
{
SetMethood();
} while (running);
}

public delegate void SetMethod();

public static void Stop()
{
running = false;
}
}
}

0 comments on commit f125cbc

Please sign in to comment.