Skip to content

Commit

Permalink
Use reentrant API when MULTIPLICITY
Browse files Browse the repository at this point in the history
Prior to this commit it was only done when using threads.  You can have
MULTIPLICITY without threads.  And when you do, there is shared global
data that can get clobbered, and which the reentrant API automagically
greatly reduces the possibility of.

I claim that the prior situation indicates that it is pretty rare in
practice to have MULTIPLICITY defined without threads.  Otherwise, we
would be getting tickets about race conditions.  I believe @Leont thinks
that many programs would not use the affected libc calls, so this
wouldn't be occurring much in the field.
  • Loading branch information
khwilliamson committed Dec 15, 2023
1 parent 66e51f4 commit 0c4822b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ no normal arguments, and used by L</C<comma_pDEPTH>> itself.
/* Use the reentrant APIs like localtime_r and getpwent_r */
/* Win32 has naturally threadsafe libraries, no need to use any _r variants.
* XXX KEEP makedef.pl copy of this code in sync */
#if defined(USE_ITHREADS) && !defined(USE_REENTRANT_API) && !defined(WIN32)
#if defined(MULTIPLICITY) && !defined(USE_REENTRANT_API) && !defined(WIN32)
# define USE_REENTRANT_API
#endif

Expand Down

0 comments on commit 0c4822b

Please sign in to comment.