From 9164b31d32e1bf9724a5d6a3b0a3420497a3c8f5 Mon Sep 17 00:00:00 2001 From: reinelt Date: Thu, 8 Apr 2004 10:48:25 +0000 Subject: [lcd4linux @ 2004-04-08 10:48:23 by reinelt] finished plugin_exec modified thread handling added '%x' format to qprintf (hexadecimal) git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@410 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- thread.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 8e4e8e4..f59396c 100644 --- a/thread.c +++ b/thread.c @@ -1,4 +1,4 @@ -/* $Id: thread.c,v 1.2 2004/03/20 07:31:33 reinelt Exp $ +/* $Id: thread.c,v 1.3 2004/04/08 10:48:25 reinelt Exp $ * * thread handling (mutex, shmem, ...) * @@ -26,6 +26,11 @@ * * * $Log: thread.c,v $ + * Revision 1.3 2004/04/08 10:48:25 reinelt + * finished plugin_exec + * modified thread handling + * added '%x' format to qprintf (hexadecimal) + * * Revision 1.2 2004/03/20 07:31:33 reinelt * support for HD66712 (which has a different RAM layout) * further threading development @@ -140,13 +145,14 @@ int shm_create (void **buffer, int size) } -void shm_destroy (int shmid) +void shm_destroy (int shmid, void *buffer) { + shmdt (buffer); shmctl(shmid, IPC_RMID, NULL); } -int thread_create (char *name, void (*thread)(char *name)) +int thread_create (char *name, void (*thread)(void *data), void *data) { pid_t pid, ppid; @@ -158,7 +164,7 @@ int thread_create (char *name, void (*thread)(char *name)) return -1; case 0: info ("thread %s starting...", name); - thread(name); + thread(data); info ("thread %s ended.", name); exit (0); default: -- cgit v1.2.3