Security Plugin: set http status for URL rule match
[MonkeyD.git] / src / worker.c
blobfba5b9551d953b51931d305275b274d8a8a467b7
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /* Monkey HTTP Daemon
4 * ------------------
5 * Copyright (C) 2001-2010, Eduardo Silva P. <edsiper@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
17 * Youu should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include <pthread.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <unistd.h>
27 pthread_t mk_worker_spawn(void (*func) (void *))
29 pthread_t tid;
30 pthread_attr_t thread_attr;
32 pthread_attr_init(&thread_attr);
33 pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
34 if (pthread_create(&tid, &thread_attr, (void *) func, NULL) < 0) {
35 perror("pthread_create");
36 exit(1);
39 return tid;