ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/xthread.h
(Generate patch)

Comparing libeio/xthread.h (file contents):
Revision 1.12 by root, Thu Jul 14 19:34:39 2011 UTC vs.
Revision 1.16 by root, Thu Oct 11 03:20:52 2012 UTC

14#endif 14#endif
15 15
16///////////////////////////////////////////////////////////////////////////// 16/////////////////////////////////////////////////////////////////////////////
17 17
18#ifdef _WIN32 18#ifdef _WIN32
19typedef int ssize_t;
20 19
21#define NTDDI_VERSION NTDDI_WIN2K // needed to get win2000 api calls 20#define NTDDI_VERSION NTDDI_WIN2K // needed to get win2000 api calls
22#define _WIN32_WINNT 0x400 21#define _WIN32_WINNT 0x400
23#include <stdio.h>//D 22#include <stdio.h>//D
24#include <fcntl.h> 23#include <fcntl.h>
31#define sigset_t int 30#define sigset_t int
32#define sigfillset(a) 31#define sigfillset(a)
33#define pthread_sigmask(a,b,c) 32#define pthread_sigmask(a,b,c)
34#define sigaddset(a,b) 33#define sigaddset(a,b)
35#define sigemptyset(s) 34#define sigemptyset(s)
36#define sigfillset(s)
37 35
38typedef pthread_mutex_t xmutex_t; 36typedef pthread_mutex_t xmutex_t;
39#define X_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER 37#define X_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
40#define X_MUTEX_CREATE(mutex) pthread_mutex_init (&(mutex), 0) 38#define X_MUTEX_CREATE(mutex) pthread_mutex_init (&(mutex), 0)
41#define X_LOCK(mutex) pthread_mutex_lock (&(mutex)) 39#define X_LOCK(mutex) pthread_mutex_lock (&(mutex))
47#define X_COND_SIGNAL(cond) pthread_cond_signal (&(cond)) 45#define X_COND_SIGNAL(cond) pthread_cond_signal (&(cond))
48#define X_COND_WAIT(cond,mutex) pthread_cond_wait (&(cond), &(mutex)) 46#define X_COND_WAIT(cond,mutex) pthread_cond_wait (&(cond), &(mutex))
49#define X_COND_TIMEDWAIT(cond,mutex,to) pthread_cond_timedwait (&(cond), &(mutex), &(to)) 47#define X_COND_TIMEDWAIT(cond,mutex,to) pthread_cond_timedwait (&(cond), &(mutex), &(to))
50 48
51typedef pthread_t xthread_t; 49typedef pthread_t xthread_t;
52#define X_THREAD_PROC(name) void *name (void *thr_arg) 50#define X_THREAD_PROC(name) static void *name (void *thr_arg)
53#define X_THREAD_ATFORK(a,b,c) 51#define X_THREAD_ATFORK(a,b,c)
54 52
55static int 53static int
56thread_create (xthread_t *tid, void *(*proc)(void *), void *arg) 54xthread_create (xthread_t *tid, void *(*proc)(void *), void *arg)
57{ 55{
58 int retval; 56 int retval;
59 pthread_attr_t attr; 57 pthread_attr_t attr;
60 58
61 pthread_attr_init (&attr); 59 pthread_attr_init (&attr);
132#ifndef X_STACKSIZE 130#ifndef X_STACKSIZE
133# define X_STACKSIZE sizeof (void *) * 4096 131# define X_STACKSIZE sizeof (void *) * 4096
134#endif 132#endif
135 133
136static int 134static int
137thread_create (xthread_t *tid, void *(*proc)(void *), void *arg) 135xthread_create (xthread_t *tid, void *(*proc)(void *), void *arg)
138{ 136{
139 int retval; 137 int retval;
140 sigset_t fullsigset, oldsigset; 138 sigset_t fullsigset, oldsigset;
141 pthread_attr_t attr; 139 pthread_attr_t attr;
142 140

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines