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

Comparing IO-AIO/xthread.h (file contents):
Revision 1.2 by root, Sun Jul 8 09:09:34 2007 UTC vs.
Revision 1.3 by root, Sun Jul 8 11:05:36 2007 UTC

75 *tid = 0; 75 *tid = 0;
76 CreateThread (0, 4096, proc, arg, 0, tid); 76 CreateThread (0, 4096, proc, arg, 0, tid);
77 return !!*tid; 77 return !!*tid;
78} 78}
79 79
80int Perl_my_socketpair (int family, int type, int protocol, int fd[2]);
81
82static int
83create_pipe (int fd[2])
84{
85 int arg = 1;
86 Perl_my_socketpair (AF_UNIX, SOCK_STREAM, 0, fd);
87 ioctlsocket (fd [0], FIONBIO, &arg);
88 ioctlsocket (fd [1], FIONBIO, &arg);
89
90 return 1;
91}
92
93#else 80#else
94///////////////////////////////////////////////////////////////////////////// 81/////////////////////////////////////////////////////////////////////////////
95 82
96/* solaris */ 83/* solaris */
97#define _POSIX_PTHREAD_SEMANTICS 1 84#define _POSIX_PTHREAD_SEMANTICS 1
105 92
106#include <unistd.h> 93#include <unistd.h>
107#include <fcntl.h> 94#include <fcntl.h>
108#include <signal.h> 95#include <signal.h>
109#include <pthread.h> 96#include <pthread.h>
110
111#ifndef PTHREAD_STACK_MIN
112/* care for broken platforms, e.g. windows */
113# define PTHREAD_STACK_MIN 16384
114#endif
115 97
116typedef pthread_mutex_t mutex_t; 98typedef pthread_mutex_t mutex_t;
117#if __linux && defined (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP) 99#if __linux && defined (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP)
118# define X_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP 100# define X_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
119#else 101#else
152 pthread_sigmask (SIG_SETMASK, &oldsigset, 0); 134 pthread_sigmask (SIG_SETMASK, &oldsigset, 0);
153 135
154 return retval; 136 return retval;
155} 137}
156 138
157static int
158create_pipe (int fd[2])
159{
160 if (pipe (fd)
161 || fcntl (fd [0], F_SETFL, O_NONBLOCK)
162 || fcntl (fd [1], F_SETFL, O_NONBLOCK))
163 return 0;
164
165 return 1;
166}
167
168#endif
169
170#if __ia64
171# define STACKSIZE 65536
172#elif __i386 || __x86_64 /* 16k is unreasonably high :( */
173# define STACKSIZE PTHREAD_STACK_MIN
174#else
175# define STACKSIZE 16384
176#endif 139#endif
177 140
178 141
142

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines