#include <why-thread.h>
#include <why-time.h>
#include <print>

int main()
{
    Why::init();

    auto thread1 = Why::Thread::create(
        [](){
            for (;;)
                std::println("1");
        },
        Why::Thread::Priority::Medium
    );
    if (! thread1) {
        std::println(stderr, "thread creation failed: {}", thread1.error().msg());
        return 1;
    }
    auto thread2 = Why::Thread::create(
        [](){
            for (;;)
                std::println("2");
        },
        Why::Thread::Priority::Medium
    );
    if (! thread2) {
        std::println(stderr, "thread creation failed: {}", thread2.error().msg());
        return 1;
    }

    Why::pause();
    return 0;
}
