diff options
-rw-r--r-- | perl.h | 24 | ||||
-rw-r--r-- | perlvars.h | 2 |
2 files changed, 13 insertions, 13 deletions
@@ -7003,19 +7003,19 @@ cannot have changed since the precalculation. #endif /* !USE_LOCALE_NUMERIC */ #ifdef USE_ITHREADS - /* On some platforms it would be safe to use a read/write mutex with many - * readers possible at the same time. On other platforms, notably IBM ones, - * subsequent getenv calls destroy earlier ones. Those platforms would not - * be able to handle simultaneous getenv calls */ -# define ENV_LOCK MUTEX_LOCK(&PL_env_mutex) -# define ENV_UNLOCK MUTEX_UNLOCK(&PL_env_mutex) -# define ENV_INIT MUTEX_INIT(&PL_env_mutex); -# define ENV_TERM MUTEX_DESTROY(&PL_env_mutex); +# define ENV_LOCK PERL_WRITE_LOCK(&PL_env_mutex) +# define ENV_UNLOCK PERL_WRITE_UNLOCK(&PL_env_mutex) +# define ENV_READ_LOCK PERL_READ_LOCK(&PL_env_mutex) +# define ENV_READ_UNLOCK PERL_READ_UNLOCK(&PL_env_mutex) +# define ENV_INIT PERL_RW_MUTEX_INIT(&PL_env_mutex) +# define ENV_TERM PERL_RW_MUTEX_DESTROY(&PL_env_mutex) #else -# define ENV_LOCK NOOP -# define ENV_UNLOCK NOOP -# define ENV_INIT NOOP -# define ENV_TERM NOOP +# define ENV_LOCK NOOP +# define ENV_UNLOCK NOOP +# define ENV_READ_LOCK NOOP +# define ENV_READ_UNLOCK NOOP +# define ENV_INIT NOOP +# define ENV_TERM NOOP #endif #ifndef PERL_NO_INLINE_FUNCTIONS diff --git a/perlvars.h b/perlvars.h index 1bbe5e3ed3..3bfd46fe94 100644 --- a/perlvars.h +++ b/perlvars.h @@ -104,7 +104,7 @@ PERLVARI(G, mmap_page_size, IV, 0) #if defined(USE_ITHREADS) PERLVAR(G, hints_mutex, perl_mutex) /* Mutex for refcounted he refcounting */ -PERLVAR(G, env_mutex, perl_mutex) /* Mutex for accessing ENV */ +PERLVAR(G, env_mutex, perl_RnW1_mutex_t) /* Mutex for accessing ENV */ PERLVAR(G, locale_mutex, perl_mutex) /* Mutex related to locale handling */ # ifndef USE_THREAD_SAFE_LOCALE PERLVAR(G, lc_numeric_mutex, perl_mutex) /* Mutex for switching LC_NUMERIC */ |