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

Comparing libeio/xthread.h (file contents):
Revision 1.5 by root, Tue May 20 05:50:49 2008 UTC vs.
Revision 1.6 by root, Wed Apr 22 11:04:49 2009 UTC

116// the broken bsd's once more 116// the broken bsd's once more
117#ifndef PTHREAD_STACK_MIN 117#ifndef PTHREAD_STACK_MIN
118# define PTHREAD_STACK_MIN 0 118# define PTHREAD_STACK_MIN 0
119#endif 119#endif
120 120
121#ifndef XTHREAD_STACKSIZE
122# define XTHREAD_STACKSIZE sizeof (long) * 4096
123#endif
124
121static int 125static int
122thread_create (thread_t *tid, void *(*proc)(void *), void *arg) 126thread_create (thread_t *tid, void *(*proc)(void *), void *arg)
123{ 127{
124 int retval; 128 int retval;
125 sigset_t fullsigset, oldsigset; 129 sigset_t fullsigset, oldsigset;
126 pthread_attr_t attr; 130 pthread_attr_t attr;
127 131
128 pthread_attr_init (&attr); 132 pthread_attr_init (&attr);
129 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); 133 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
130 pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN < sizeof (long) * 4096 134
131 ? sizeof (long) * 4096 : PTHREAD_STACK_MIN); 135 if (XTHREAD_STACKSIZE > 0)
136 pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN > (XTHREAD_STACKSIZE)
137 ? PTHREAD_STACK_MIN : (XTHREAD_STACKSIZE));
138
132#ifdef PTHREAD_SCOPE_PROCESS 139#ifdef PTHREAD_SCOPE_PROCESS
133 pthread_attr_setscope (&attr, PTHREAD_SCOPE_PROCESS); 140 pthread_attr_setscope (&attr, PTHREAD_SCOPE_PROCESS);
134#endif 141#endif
135 142
136 sigfillset (&fullsigset); 143 sigfillset (&fullsigset);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines