common/win32/pthread_w32.h

00001 /*
00002  * Copyright Ian Burnett 2005, 2006.
00003  *
00004  * This file is part of Ian's Interactive LCD controller (IILC).
00005  * 
00006  * IILC is free software; you can redistribute it and/or modify it under
00007  * the terms of the GNU General Public License as published by the Free
00008  * Software Foundation; either version 2 of the License, or (at your
00009  * option) any later version.
00010  *
00011  * IILC is distributed in the hope that it will be useful, but WITHOUT
00012  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00014  * for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License along
00017  * with IILC; if not, write to the Free Software Foundation, Inc.,
00018  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
00019  */
00020 
00021 #if !defined(__PTHREAD_W32_H__)
00022 #define __PTHREAD_W32_H__
00023 
00024 #define pthread_mutex_t int
00025 
00026 #define pthread_once_t int
00027 
00028 #define PTHREAD_ONCE_INIT 0
00029 
00030 #define pthread_key_t int
00031 
00032 #define pthread_t int
00033 
00034 #define pthread_cond_t int
00035 
00036 #define pthread_attr_t int
00037 
00038 #define pthread_condattr_t int
00039 
00040 #define pthread_mutexattr_t int 
00041 
00042 #define PTHREAD_MUTEX_INITIALIZER 0
00043 
00044 #define PTHREAD_COND_INITIALIZER 0
00045 
00046 #define ETIMEDOUT 1
00047 
00048 /****************************************************************************
00049  *                                                                          *
00050  *                            SEMAPHORE FUNCTIONS                           *
00051  *                                                                          *
00052  ****************************************************************************/
00053 
00054 int pthread_cond_init(pthread_cond_t * cond,
00055                       const pthread_condattr_t * attr);
00056 
00057 int pthread_cond_destroy(pthread_cond_t * cond);
00058 
00059 int pthread_cond_broadcast(pthread_cond_t *cond);
00060 
00061 int pthread_cond_signal(pthread_cond_t *cond);
00062 
00063 int pthread_cond_timedwait(pthread_cond_t * cond,
00064                            pthread_mutex_t * mutex,
00065                            const struct timespec * abstime);
00066 
00067 int pthread_cond_wait(pthread_cond_t * cond,
00068                       pthread_mutex_t * mutex);
00069 
00070 /****************************************************************************
00071  *                                                                          *
00072  *                              MUTEX FUNCTIONS                             *
00073  *                                                                          *
00074  ****************************************************************************/
00075 
00076 int pthread_mutex_init(pthread_mutex_t * mutex,
00077                        const pthread_mutexattr_t * attr);
00078 
00079 int pthread_mutex_destroy(pthread_mutex_t * mutex);
00080 
00081 int pthread_mutex_lock(pthread_mutex_t * mutex);
00082 
00083 int pthread_mutex_trylock(pthread_mutex_t * mutex);
00084 
00085 int pthread_mutex_unlock(pthread_mutex_t * mutex);
00086 
00087 int pthread_once(pthread_once_t * once_control,
00088                  void (*init_routine)(void));
00089 
00090 
00091 /****************************************************************************
00092  *                                                                          *
00093  *                               TLS FUNCTIONS                              *
00094  *                                                                          *
00095  ****************************************************************************/
00096 
00097 int pthread_key_create(pthread_key_t * key,
00098                        void (*destructor)(void*));
00099 
00100 void * pthread_getspecific(pthread_key_t key);
00101 
00102 int pthread_setspecific(pthread_key_t key, 
00103                         const void *value);
00104 
00105 
00106 /****************************************************************************
00107  *                                                                          *
00108  *                              THREAD FUNCTIONS                            *
00109  *                                                                          *
00110  ****************************************************************************/
00111 
00112 int pthread_create(pthread_t * thread,
00113                    const pthread_attr_t * attr,
00114                    void * (*start_routine)(void *),
00115                    void * arg);
00116 
00117 int pthread_join(pthread_t thread,
00118                  void ** value_ptr);
00119 
00120 
00121 #endif /* __PTHREAD_W32_H__ */
00122 

Generated on Mon Jul 17 01:36:11 2006 for IILC by  doxygen 1.4.6