feat: alternate syntax for threads

This commit is contained in:
maelstrom 2026-05-28 18:04:14 +02:00
commit aa57bab764
6 changed files with 70 additions and 7 deletions

View file

@ -14,7 +14,11 @@ namespace fishbone {
Impl* impl;
public:
Thread(void (*call)(fishbone::Thread* thread, void* arg), void* arg);
using Callable = void(*)(fishbone::Thread* thread, void* arg);
using CallableFunc = std::function<void(fishbone::Thread* thread)>;
Thread(Callable call, void* arg);
Thread(CallableFunc call);
~Thread();
void join();