mirror of
https://github.com/justinian/jsix.git
synced 2025-12-11 00:44:31 -08:00
[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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user