Skip to content

Commit

Permalink
Remove ENV_LOCALE_LOCK/UNLOCK macros
Browse files Browse the repository at this point in the history
These are subsumed by gwENVr_LOCALEr_LOCK created in the previous
commit.
  • Loading branch information
khwilliamson committed Apr 29, 2021
1 parent b6d9dd2 commit 98a2b0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
19 changes: 5 additions & 14 deletions perl.h
Expand Up @@ -7198,20 +7198,11 @@ END_EXTERN_C

#endif

/* Some critical sections need to lock both the locale and the environment.
* XXX khw intends to change this to lock both mutexes, but that brings up
* issues of potential deadlock, so should be done at the beginning of a
* development cycle. So for now, it just locks the environment. Note that
* many modern platforms are locale-thread-safe anyway, so locking the locale
* mutex is a no-op anyway */
#define ENV_LOCALE_LOCK ENV_LOCK
#define ENV_LOCALE_UNLOCK ENV_UNLOCK

/* And some critical sections care only that no one else is writing either the
* locale nor the environment. XXX Again this is for the future. This can be
* simulated with using COND_WAIT in thread.h */
#define ENV_LOCALE_READ_LOCK ENV_LOCALE_LOCK
#define ENV_LOCALE_READ_UNLOCK ENV_LOCALE_UNLOCK
/* Some critical sections care only that no one else is writing either the
* locale nor the environment. XXX This is for the future; in the meantime
* just use an exclusive lock */
#define ENV_LOCALE_READ_LOCK gwENVr_LOCALEr_LOCK
#define ENV_LOCALE_READ_UNLOCK gwENVr_LOCALEr_UNLOCK

#define Atof my_atof

Expand Down
8 changes: 4 additions & 4 deletions time64.c
Expand Up @@ -132,15 +132,15 @@ static const short safe_years[SOLAR_CYCLE_LENGTH] = {
# define LOCALTIME_LOCK ENV_LOCALE_READ_LOCK
# define LOCALTIME_UNLOCK ENV_LOCALE_READ_UNLOCK
# else
# define LOCALTIME_LOCK ENV_LOCALE_LOCK
# define LOCALTIME_UNLOCK ENV_LOCALE_UNLOCK
# define LOCALTIME_LOCK gwENVr_LOCALEr_LOCK
# define LOCALTIME_UNLOCK gwENVr_LOCALEr_UNLOCK
# endif
# ifdef PERL_REENTR_USING_GMTIME_R
# define GMTIME_LOCK ENV_LOCALE_READ_LOCK
# define GMTIME_UNLOCK ENV_LOCALE_READ_UNLOCK
# else
# define GMTIME_LOCK ENV_LOCALE_LOCK
# define GMTIME_UNLOCK ENV_LOCALE_UNLOCK
# define GMTIME_LOCK gwENVr_LOCALEr_LOCK
# define GMTIME_UNLOCK gwENVr_LOCALEr_UNLOCK
# endif
#else /* Reentrant not needed, so races not possible */
# define LOCALTIME_LOCK NOOP
Expand Down

0 comments on commit 98a2b0c

Please sign in to comment.