#pragma once

#include "commons/commons_macros.h"
#include "commons/commons_region_alloc_def.h"
#include "commons/commons_span.h"

struct _thread;
using thread = _thread*;
using thread_array = span<_thread>;

auto API Thread_Create(region_alloc& alloc, void (*fn)(void* userdata), void* userdata) -> thread;
void API Thread_Join(thread self);

auto API Thread_CreateMultiple(region_alloc& alloc, uint32_t numberToCreate, void (*fn)(void* userdata), void* userdata)
    -> thread_array;
