aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2005-06-10[lcd4linux @ 2005-06-10 04:54:10 by reinelt]reinelt1-6425/+0
removed ltmain.sh
2005-06-10[lcd4linux @ 2005-06-10 04:53:44 by reinelt]reinelt1-7040/+0
removed libtool and ltmain.sh
2005-06-09[lcd4linux @ 2005-06-09 17:41:47 by reinelt]reinelt3-160/+312
M50530 fixes (many thanks to Szymon Bieganski)
2005-06-06[lcd4linux @ 2005-06-06 09:24:07 by reinelt]reinelt2-6/+9
two bugs in plugin_mysql.c fixed
2005-06-03[lcd4linux @ 2005-06-03 17:04:52 by reinelt]reinelt3-205/+10
hopefully solved the AM_PYTHON_PATH issue finally
2005-06-03[lcd4linux @ 2005-06-03 04:45:57 by reinelt]reinelt3-4/+8
renamed AM_PYTHON to MY_PYTHON...
2005-06-01[lcd4linux @ 2005-06-01 12:50:25 by reinelt]reinelt1-184/+178
ifdef'ed unused function to avoid compiler warning
2005-06-01[lcd4linux @ 2005-06-01 12:46:31 by reinelt]reinelt4-22/+52
--with-python added to configure
2005-06-01[lcd4linux @ 2005-06-01 12:09:11 by reinelt]reinelt5-672/+641
removed ^M from lcd4linux_i2c.h; indent.sh run
2005-06-01[lcd4linux @ 2005-06-01 11:17:54 by pk_richman]pk_richman1-1497/+1500
marked unused parameters
2005-05-31[lcd4linux @ 2005-05-31 21:30:56 by lfcorreia]lfcorreia3-11/+14
fix my email address
2005-05-31[lcd4linux @ 2005-05-31 21:28:42 by lfcorreia]lfcorreia1-11/+11
fix typo
2005-05-31[lcd4linux @ 2005-05-31 21:26:56 by lfcorreia]lfcorreia1-2/+5
fix my email address
2005-05-31[lcd4linux @ 2005-05-31 21:06:36 by lfcorreia]lfcorreia1-0/+4
replace the accidently deleted Python detection code
2005-05-31[lcd4linux @ 2005-05-31 20:42:54 by lfcorreia]lfcorreia8-1819/pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* $Id: thread.c,v 1.7 2005/05/08 04:32:45 reinelt Exp $
 *
 * thread handling (mutex, shmem, ...)
 *
 * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at>
 * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
 *
 * parts of this code are based on the old XWindow driver which is
 * Copyright (C) 2000 Herbert Rosmanith <herp@wildsau.idv.uni-linz.ac.at>
 *
 * This file is part of LCD4Linux.
 *
 * LCD4Linux is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * LCD4Linux is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *
 * $Log: thread.c,v $
 * Revision 1.7  2005/05/08 04:32:45  reinelt
 * CodingStyle added and applied
 *
 * Revision 1.6  2005/01/18 06:30:23  reinelt
 * added (C) to all copyright statements
 *
 * Revision 1.5  2004/06/20 10:09:56  reinelt
 *
 * 'const'ified the whole source
 *
 * Revision 1.4  2004/06/01 06:45:30  reinelt
 *
 * some Fixme's processed
 * documented some code
 *
 * 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
 *
 * Revision 1.1  2004/03/19 06:37:47  reinelt
 * asynchronous thread handling started
 *
 */

/* 
 * exported functions:
 * 
 * int  mutex_create  (void);
 *   creates a mutex and treturns its ID
 * 
 * void mutex_lock    (int semid);
 *   try to lock a mutex
 *
 * void mutex_unlock  (int semid);
 *   unlock a mutex
 *
 * void mutex_destroy (int semid);
 *   release a mutex
 *
 *
 * int shm_create    (void **buffer, int size);
 *   create shared memory segment
 *
 * void shm_destroy   (int shmid, void *buffer) ;
 *   release shared memory segment
 *
 * int thread_create (char *name, void (*thread)(void *data), void *data);
 *   create a new thread
 *
 */


#include "config.h"

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include
9-30/+636
preparations for python bindings and python plugin
2005-05-02[lcd4linux @ 2005-05-02 05:15:46 by reinelt]reinelt4-9/+51
make busy-flag checking configurable for LCD-Linux driver
2005-04-30[lcd4linux @ 2005-04-30 06:02:09 by reinelt]reinelt3-15/+44
LCD-Linux display size set up from lcd4linux.conf
2005-04-24[lcd4linux @ 2005-04-24 05:27:09 by reinelt]reinelt2-7/+38
Trefon Backlight added
2005-04-24[lcd4linux @ 2005-04-24 04:41:28 by reinelt]reinelt1-0/+68
Changelog updated
2005-04-24[lcd4linux @ 2005-04-24 04:33:46 by reinelt]reinelt9-10/+444
driver for TREFON USB LCD's added
2005-04-20[lcd4linux @ 2005-04-20 05:49:21 by reinelt]reinelt1-44/+125
Changed the code to add some VT100-compatible control sequences (see the comments above). A configfile boolean option 'VT100_Support' (default to 1) indicate if the display in used support these control-sequences or not.
2005-04-09[lcd4linux @ 2005-04-09 07:36:42 by reinelt]reinelt2-17/+99
updated LCD-Linux driver to version 0.8.8
2005-04-05[lcd4linux @ 2005-04-05 06:57:39 by reinelt]reinelt3-34/+34
AC_CHECK_HEADERS corrected
2005-04-05[lcd4linux @ 2005-04-05 05:12:48 by reinelt]reinelt4-407/+33
i2c patch from Paul (still does not work here :-(
2005-04-05[lcd4linux @ 2005-04-05 04:46:06 by reinelt]reinelt1-1/+20
ceil/floor patch from Maxime
2005-04-04[lcd4linux @ 2005-04-04 20:11:14 by nicowallmeier]nicowallmeier1-2/+6
to be compatible with gcc 2.95
2005-04-03[lcd4linux @ 2005-04-03 07:07:43 by reinelt]reinelt8-9/+152
added statfs plugin
2005-04-02[lcd4linux @ 2005-04-02 05:28:58 by reinelt]reinelt3-19/+27
fixed gcc4 warnings about signed/unsigned mismatches
2005-04-01[lcd4linux @ 2005-04-01 05:16:04 by reinelt]reinelt5-584/+694
moved plugin init stuff to a seperate function called on first use
2005-03-30[lcd4linux @ 2005-03-30 04:57:50 by reinelt]reinelt3-23/+67
Evaluator speedup: use bsearch for finding functions and variables
semctl(semid, 0, IPC_RMID, arg); } int shm_create(void **buffer, const int size) { int shmid; shmid = shmget(IPC_PRIVATE, size, SHM_R | SHM_W); if (shmid == -1) { error("fatal error: shmget() failed: %s", strerror(errno)); return -1; } *buffer = shmat(shmid, NULL, 0); if (*buffer == NULL) { error("fatal error: shmat() failed: %s", strerror(errno)); return -1; } return shmid; } void shm_destroy(const int shmid, const void *buffer) { shmdt(buffer); shmctl(shmid, IPC_RMID, NULL); } int thread_create(const char *name, void (*thread) (void *data), void *data) { pid_t pid, ppid; ppid = getpid(); switch (pid = fork()) { case -1: error("fatal error: fork(%s) failed: %s", name, strerror(errno)); return -1; case 0: info("thread %s starting...", name); thread(data); info("thread %s ended.", name); exit(0); default: info("forked process %d for thread %s", pid, name); } return pid; }