summary refs log tree commit diff stats
path: root/plugins/dns/thread.c
diff options
context:
space:
mode:
authorberkeviktor@aol.com <berkeviktor@aol.com>2010-09-28 16:29:40 +0200
committerberkeviktor@aol.com <berkeviktor@aol.com>2010-09-28 16:29:40 +0200
commit1141b25b6dbdc9fc6c0eeee8c52b15cdfeb30c92 (patch)
tree02a368af9146be5cd8dcb3cafb69e0110c9b3c6f /plugins/dns/thread.c
parent868f46edf88db6828293173301990cdb2cfb6571 (diff)
parenta8349ce6cb204bbd6917d2076b1e0da2dc6d817b (diff)
Merge
Diffstat (limited to 'plugins/dns/thread.c')
-rw-r--r--plugins/dns/thread.c111
1 files changed, 0 insertions, 111 deletions
diff --git a/plugins/dns/thread.c b/plugins/dns/thread.c
deleted file mode 100644
index aa153137..00000000
--- a/plugins/dns/thread.c
+++ /dev/null
@@ -1,111 +0,0 @@
-#include <stdlib.h>
-
-#define USE_PTHREAD
-
-#ifdef WIN32
-
-#include <windows.h>
-#define pthread_t DWORD
-#define pipe(a) _pipe(a,4096,_O_BINARY)
-
-#else
-#ifdef USE_PTHREAD
-
-#include <pthread.h>
-
-#else
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#define pthread_t int
-
-#endif
-#endif
-
-
-typedef struct
-{
-	pthread_t threadid;
-	int pipe_fd[2];
-	void *userdata;
-} thread;
-
-thread *
-thread_new (void)
-{
-	thread *th;
-
-	th = calloc (1, sizeof (*th));
-	if (!th)
-		return NULL;
-
-	if (pipe (th->pipe_fd) == -1)
-	{
-		free (th);
-		return NULL;
-	}
-
-#ifdef __EMX__ /* os/2 */
-	setmode (pipe_fd[0], O_BINARY);
-	setmode (pipe_fd[1], O_BINARY);
-#endif
-
-	return th;
-}
-
-int
-thread_start (thread *th, void *(*start_routine)(void *), void *arg)
-{
-	pthread_t id;
-
-#ifdef WIN32
-	CloseHandle (CreateThread (NULL, 0,
-										(LPTHREAD_START_ROUTINE)start_routine,
-										arg, 0, (DWORD *)&id));
-#else
-#ifdef USE_PTHREAD
-	if (pthread_create (&id, NULL, start_routine, arg) != 0)
-		return 0;
-#else
-	switch (id = fork ())
-	{
-	case -1:
-		return 0;
-	case 0:
-		/* this is the child */
-		setuid (getuid ());
-		start_routine (arg);
-		_exit (0);
-	}
-#endif
-#endif
-
-	th->threadid = id;
-
-	return 1;
-}
-
-/*void
-thread_kill (thread *th)
-{
-#ifdef WIN32
-	PostThreadMessage (th->threadid, WM_QUIT, 0, 0);
-#else
-#ifdef USE_PTHREAD
-	pthread_cancel (th->threadid);
-	pthread_join (th->threadid, (void *)&th);
-#else
-	kill (th->threadid, SIGKILL);
-	waitpid (th->threadid, NULL, 0);
-#endif
-#endif
-}
-
-void
-thread_free (thread *th)
-{
-	close (th->pipe_fd[0]);
-	close (th->pipe_fd[1]);
-	free (th);
-}*/