Esempio n. 1
0
int
main(void)
{
    lthread_t *lt;
    lthread_create(&lt, udp_server, NULL);
    lthread_run();

    return 0;
 }
Esempio n. 2
0
int
main(int argc, char **argv)
{
	lthread_t *lt = NULL;
    int pipes[2];
    lthread_pipe(pipes);

	lthread_create(&lt, read_pipe, pipes);
	lthread_create(&lt, write_pipe, pipes);
	lthread_run();

	return 0;
}
Esempio n. 3
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(&lt, (void*)lt_main, (void*)srv);

    //lt = NULL;
    //lthread_create(&lt, (void*)lt_signal, (void*)srv);

    lthread_run();
}
Esempio n. 4
0
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(&lt, 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;
}