summaryrefslogtreecommitdiff
path: root/os2
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-11-28 19:08:21 -0700
committerKarl Williamson <khw@cpan.org>2022-09-29 13:08:27 -0600
commit6700fa0429aa6b3c06e76e4d2187944d46c59d8e (patch)
tree73e2ca4c6b693858185514f8d52da8b72d1cfb7b /os2
parentee704dcec563f56c609a5fd1f8496cbaa8ca2015 (diff)
downloadperl-6700fa0429aa6b3c06e76e4d2187944d46c59d8e.tar.gz
os2: Use many reader lock instead of exclusive
This is just reading the environment, not changing it, so many readers can be accessing it at the same time.
Diffstat (limited to 'os2')
-rw-r--r--os2/os2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/os2/os2.c b/os2/os2.c
index 0d29d13251..6fa0028ab9 100644
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -5047,14 +5047,14 @@ my_tmpnam (char *str)
char *p = PerlEnv_getenv("TMP"), *tpath;
if (!p) p = PerlEnv_getenv("TEMP");
- ENV_LOCK;
+ ENV_READ_LOCK;
tpath = tempnam(p, "pltmp");
if (str && tpath) {
strcpy(str, tpath);
- ENV_UNLOCK;
+ ENV_READ_UNLOCK;
return str;
}
- ENV_UNLOCK;
+ ENV_READ_UNLOCK;
return tpath;
}