Skip to content

Commit

Permalink
STRFTIME_LOCK needs an unchanging locale
Browse files Browse the repository at this point in the history
So, the locale must be locked from being written to as well as the
environment.
  • Loading branch information
khwilliamson committed Feb 27, 2024
1 parent 42e9f41 commit 5719985
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7316,9 +7316,6 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define LC_COLLATE_LOCK LOCALE_LOCK
# define LC_COLLATE_UNLOCK LOCALE_UNLOCK

# define STRFTIME_LOCK ENV_LOCK
# define STRFTIME_UNLOCK ENV_UNLOCK

/* Some critical sections need to lock both the locale and the environment from
* changing, while allowing for any number of readers. To avoid deadlock, this
* is always done in the same order. These should always be invoked, like all
Expand All @@ -7329,6 +7326,9 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
#define ENVr_LOCALEr_UNLOCK \
STMT_START { ENV_READ_UNLOCK; LOCALE_READ_UNLOCK; } STMT_END

#define STRFTIME_LOCK ENVr_LOCALEr_LOCK
#define STRFTIME_UNLOCK ENVr_LOCALEr_UNLOCK

/* These time-related functions all requre that the environment and locale
* don't change while they are executing (at least in glibc; this appears to be
* contrary to the POSIX standard). tzset() writes global variables, so
Expand Down

0 comments on commit 5719985

Please sign in to comment.