aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-20 07:31:33 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-20 07:31:33 +0000
commit9288c604585993b787b4552b3f7f3f5ad1cd1c81 (patch)
treeab24bff16e3bfdfb0d3214d1f3ae2eac95d133aa /thread.c
parent42fbc61ad0f0f9d165c19a0e8aa33b9d5f7f303b (diff)
downloadlcd4linux-9288c604585993b787b4552b3f7f3f5ad1cd1c81.tar.gz
[lcd4linux @ 2004-03-20 07:31:32 by reinelt]
support for HD66712 (which has a different RAM layout) further threading development git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@405 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/thread.c b/thread.c
index 86673ba..8e4e8e4 100644
--- a/thread.c
+++ b/thread.c
@@ -1,4 +1,4 @@
-/* $Id: thread.c,v 1.1 2004/03/19 06:37:47 reinelt Exp $
+/* $Id: thread.c,v 1.2 2004/03/20 07:31:33 reinelt Exp $
*
* thread handling (mutex, shmem, ...)
*
@@ -26,6 +26,10 @@
*
*
* $Log: thread.c,v $
+ * Revision 1.2 2004/03/20 07:31:33 reinelt
+ * support for HD66712 (which has a different RAM layout)
+ * further threading development
+ *
* Revision 1.1 2004/03/19 06:37:47 reinelt
* asynchronous thread handling started
*
@@ -142,28 +146,24 @@ void shm_destroy (int shmid)
}
-int thread_create (void (*thread)(void))
+int thread_create (char *name, void (*thread)(char *name))
{
- /*
+ pid_t pid, ppid;
+
ppid=getpid();
- switch(async_updater_pid=fork()) {
+ switch (pid = fork()) {
case -1:
- error ("X11: fork() failed: %s", strerror(errno));
+ error ("fatal error: fork(%s) failed: %s", name, strerror(errno));
return -1;
-
case 0:
- async_update();
- error ("X11: async_update failed");
- kill(ppid,SIGTERM);
- exit(-1);
-
+ info ("thread %s starting...", name);
+ thread(name);
+ info ("thread %s ended.", name);
+ exit (0);
default:
- break;
+ info ("forked process %d for thread %s", pid, name);
}
-
- signal(SIGCHLD,quit_updater);
- atexit(quit_updater);
- */
- return 0;
+
+ return pid;
}