[libj6] Make j6::thread a template for lambdas

Instead of a C-style function pointer taking `void *userdata`, let
j6::thread take a lambda as its thread procedure.
This commit is contained in:
Justin C. Miller
2023-08-09 21:07:09 -07:00
parent 8b3fa3ed01
commit 3cfd0cf86b
4 changed files with 47 additions and 78 deletions

View File

@@ -111,8 +111,8 @@ main(int argc, const char **argv)
j6_log("main thread created channel");
j6::thread child_thread {thread_proc, stack_top};
j6_status_t result = child_thread.start(chan);
j6::thread child_thread {[=](){ thread_proc(chan); }, stack_top};
j6_status_t result = child_thread.start();
if (result != j6_status_ok)
return result;