X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/28a8002413ccedcfa8e94526c4bee315c7196d59..42dd67ca0471eb6dbdf676a529268c19897815c2:/thread.h diff --git a/thread.h b/thread.h index 955be24..15d2665 100644 --- a/thread.h +++ b/thread.h @@ -1,6 +1,7 @@ /* thread.h * - * Copyright (C) 1999, 2000, 2001, 2002, by Larry Wall and others + * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + * by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -39,9 +40,6 @@ # define NEED_PTHREAD_INIT # define PTHREAD_CREATE_JOINABLE (1) # endif -# ifdef __OPEN_VM -# define pthread_addr_t void * -# endif # ifdef OEMVS # define pthread_addr_t void * # define pthread_create(t,a,s,d) pthread_create(t,&(a),s,d) @@ -64,7 +62,7 @@ # define pthread_mutexattr_init(a) pthread_mutexattr_create(a) # define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t) # endif -# if defined(DJGPP) || defined(__OPEN_VM) || defined(OEMVS) +# if defined(DJGPP) || defined(OEMVS) # define PTHREAD_ATTR_SETDETACHSTATE(a,s) pthread_attr_setdetachstate(a,&(s)) # define YIELD pthread_yield(NULL) # endif @@ -93,8 +91,13 @@ # endif #endif -#ifdef DGUX -# define THREAD_CREATE_NEEDS_STACK (32*1024) +#ifdef __VMS + /* Default is 1024 on VAX, 8192 otherwise */ +# ifdef __ia64 +# define THREAD_CREATE_NEEDS_STACK (48*1024) +# else +# define THREAD_CREATE_NEEDS_STACK (32*1024) +# endif #endif #ifdef I_MACH_CTHREADS @@ -150,7 +153,7 @@ #define THREAD_RET_CAST(x) ((any_t) x) #define DETACH(t) cthread_detach(t->self) -#define JOIN(t, avp) (*(avp) = (AV *)cthread_join(t->self)) +#define JOIN(t, avp) (*(avp) = MUTABLE_AV(cthread_join(t->self))) #define PERL_SET_CONTEXT(t) cthread_set_data(cthread_self(), t) #define PERL_GET_CONTEXT cthread_data(cthread_self()) @@ -332,10 +335,8 @@ #ifndef ALLOC_THREAD_KEY # define ALLOC_THREAD_KEY \ STMT_START { \ - int _eC_; \ - if ((_eC_ = pthread_key_create(&PL_thr_key, 0))) { \ - PerlIO_printf(PerlIO_stderr(), "panic: pthread_key_create (%d) [%s:%d]", \ - _eC_, __FILE__, __LINE__); \ + if (pthread_key_create(&PL_thr_key, 0)) { \ + write(2, STR_WITH_LEN("panic: pthread_key_create failed\n")); \ exit(1); \ } \ } STMT_END @@ -404,46 +405,6 @@ # define COND_DESTROY(c) #endif -#ifndef LOCK_SV_MUTEX -# define LOCK_SV_MUTEX -#endif - -#ifndef UNLOCK_SV_MUTEX -# define UNLOCK_SV_MUTEX -#endif - -#ifndef LOCK_STRTAB_MUTEX -# define LOCK_STRTAB_MUTEX -#endif - -#ifndef UNLOCK_STRTAB_MUTEX -# define UNLOCK_STRTAB_MUTEX -#endif - -#ifndef LOCK_CRED_MUTEX -# define LOCK_CRED_MUTEX -#endif - -#ifndef UNLOCK_CRED_MUTEX -# define UNLOCK_CRED_MUTEX -#endif - -#ifndef LOCK_FDPID_MUTEX -# define LOCK_FDPID_MUTEX -#endif - -#ifndef UNLOCK_FDPID_MUTEX -# define UNLOCK_FDPID_MUTEX -#endif - -#ifndef LOCK_SV_LOCK_MUTEX -# define LOCK_SV_LOCK_MUTEX -#endif - -#ifndef UNLOCK_SV_LOCK_MUTEX -# define UNLOCK_SV_LOCK_MUTEX -#endif - #ifndef LOCK_DOLLARZERO_MUTEX # define LOCK_DOLLARZERO_MUTEX #endif @@ -468,3 +429,13 @@ #ifndef INIT_THREADS # define INIT_THREADS NOOP #endif + +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * + * ex: set ts=8 sts=4 sw=4 et: + */