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

Comparing libeio/xthread.h (file contents):
Revision 1.10 by root, Tue Feb 15 03:15:16 2011 UTC vs.
Revision 1.14 by root, Tue Jul 19 05:12:16 2011 UTC

1#ifndef XTHREAD_H_ 1#ifndef XTHREAD_H_
2#define XTHREAD_H_ 2#define XTHREAD_H_
3 3
4/* whether word reads are potentially non-atomic. 4/* whether word reads are potentially non-atomic.
5 * this is conservatice, likely most arches this runs 5 * this is conservative, likely most arches this runs
6 * on have atomic word read/writes. 6 * on have atomic word read/writes.
7 */ 7 */
8#ifndef WORDACCESS_UNSAFE 8#ifndef WORDACCESS_UNSAFE
9# if __i386 || __x86_64 9# if __i386 || __x86_64
10# define WORDACCESS_UNSAFE 0 10# define WORDACCESS_UNSAFE 0
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))
128#ifndef PTHREAD_STACK_MIN 126#ifndef PTHREAD_STACK_MIN
129# define PTHREAD_STACK_MIN 0 127# define PTHREAD_STACK_MIN 0
130#endif 128#endif
131 129
132#ifndef X_STACKSIZE 130#ifndef X_STACKSIZE
133# define X_STACKSIZE sizeof (long) * 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) 135thread_create (xthread_t *tid, void *(*proc)(void *), void *arg)
138{ 136{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines