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

Comparing libeio/xthread.h (file contents):
Revision 1.6 by root, Wed Apr 22 11:04:49 2009 UTC vs.
Revision 1.7 by root, Wed Jul 15 01:36:04 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 121#ifndef X_STACKSIZE
122# define XTHREAD_STACKSIZE sizeof (long) * 4096 122# define X_STACKSIZE sizeof (long) * 4096
123#endif 123#endif
124 124
125static int 125static int
126thread_create (thread_t *tid, void *(*proc)(void *), void *arg) 126thread_create (thread_t *tid, void *(*proc)(void *), void *arg)
127{ 127{
129 sigset_t fullsigset, oldsigset; 129 sigset_t fullsigset, oldsigset;
130 pthread_attr_t attr; 130 pthread_attr_t attr;
131 131
132 pthread_attr_init (&attr); 132 pthread_attr_init (&attr);
133 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); 133 pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
134
135 if (XTHREAD_STACKSIZE > 0)
136 pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN > (XTHREAD_STACKSIZE) 134 pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN < X_STACKSIZE ? X_STACKSIZE : PTHREAD_STACK_MIN);
137 ? PTHREAD_STACK_MIN : (XTHREAD_STACKSIZE));
138
139#ifdef PTHREAD_SCOPE_PROCESS 135#ifdef PTHREAD_SCOPE_PROCESS
140 pthread_attr_setscope (&attr, PTHREAD_SCOPE_PROCESS); 136 pthread_attr_setscope (&attr, PTHREAD_SCOPE_PROCESS);
141#endif 137#endif
142 138
143 sigfillset (&fullsigset); 139 sigfillset (&fullsigset);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines