int main(void) { lthread_t *lt; lthread_create(<, udp_server, NULL); lthread_run(); return 0; }
int main(int argc, char **argv) { lthread_t *lt = NULL; int pipes[2]; lthread_pipe(pipes); lthread_create(<, read_pipe, pipes); lthread_create(<, write_pipe, pipes); lthread_run(); return 0; }
int main(void) { lthread_t *lt = NULL; proxy_server *srv = &g_srv; cdns_init(); server_init(srv); signal(SIGPIPE, SIG_IGN); /*signal(SIGINT, sig_handler); signal(SIGQUIT, sig_handler); signal(SIGUSR1, sig_handler);*/ lthread_create(<, (void*)lt_main, (void*)srv); //lt = NULL; //lthread_create(<, (void*)lt_signal, (void*)srv); lthread_run(); }
int main(int argc, char **argv) { lthread_t *lt; if (mysql_library_init(0, NULL, NULL)) { fprintf(stderr, "failed to initialize mysql library\n"); return 1; } /* many lthreads could be spawned, but mysql is very limited on connections; 100-150 is the default */ printf("running lthread...\n"); if (lthread_create(<, run_query, NULL) == -1) { fprintf(stderr, "failed to create lthread\n"); exit(1); } lthread_run(); printf("lthread scheduler finished\n"); mysql_library_end(); return 0; }