Remove thread test
This commit is contained in:
parent
c8a9fcf0d5
commit
edc9b2c3ff
@ -7,7 +7,6 @@ import hulk.klog;
|
|||||||
import hulk.list;
|
import hulk.list;
|
||||||
import hulk.time;
|
import hulk.time;
|
||||||
import hulk.hurl.a1;
|
import hulk.hurl.a1;
|
||||||
import hulk.thread;
|
|
||||||
import core.volatile;
|
import core.volatile;
|
||||||
|
|
||||||
struct Test
|
struct Test
|
||||||
@ -20,7 +19,6 @@ struct Test
|
|||||||
Klog.writefln("\a3Running kernel tests");
|
Klog.writefln("\a3Running kernel tests");
|
||||||
test_pit();
|
test_pit();
|
||||||
test_list();
|
test_list();
|
||||||
test_threads();
|
|
||||||
Klog.writefln("\a3Kernel tests complete");
|
Klog.writefln("\a3Kernel tests complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,44 +121,6 @@ struct Test
|
|||||||
assert_eq(1, s3.list_count);
|
assert_eq(1, s3.list_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static __gshared ubyte thread_test_done;
|
|
||||||
|
|
||||||
private static void test_threads()
|
|
||||||
{
|
|
||||||
static void t1()
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < 5; i++)
|
|
||||||
{
|
|
||||||
Klog.writefln("thread 1");
|
|
||||||
Time.msleep(2000u);
|
|
||||||
}
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void t2()
|
|
||||||
{
|
|
||||||
Time.msleep(1000u);
|
|
||||||
for (size_t i = 0; i < 5; i++)
|
|
||||||
{
|
|
||||||
Klog.writefln("thread 2");
|
|
||||||
Time.msleep(2000u);
|
|
||||||
}
|
|
||||||
volatileStore(&thread_test_done, 1);
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread.start(&t1);
|
|
||||||
Thread.start(&t2);
|
|
||||||
|
|
||||||
while (volatileLoad(&thread_test_done) == 0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void assert_eq(T)(T first, T second, size_t line_number = __LINE__)
|
private static void assert_eq(T)(T first, T second, size_t line_number = __LINE__)
|
||||||
{
|
{
|
||||||
if (first != second)
|
if (first != second)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user