Remove thread test

This commit is contained in:
Josh Holtrop 2023-11-28 10:47:44 -05:00
parent c8a9fcf0d5
commit edc9b2c3ff

View File

@ -7,7 +7,6 @@ import hulk.klog;
import hulk.list;
import hulk.time;
import hulk.hurl.a1;
import hulk.thread;
import core.volatile;
struct Test
@ -20,7 +19,6 @@ struct Test
Klog.writefln("\a3Running kernel tests");
test_pit();
test_list();
test_threads();
Klog.writefln("\a3Kernel tests complete");
}
@ -123,44 +121,6 @@ struct Test
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__)
{
if (first != second)