Skip to content

Commit 6700fa0

Browse files
committed
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.
1 parent ee704dc commit 6700fa0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

os2/os2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5047,14 +5047,14 @@ my_tmpnam (char *str)
50475047
char *p = PerlEnv_getenv("TMP"), *tpath;
50485048

50495049
if (!p) p = PerlEnv_getenv("TEMP");
5050-
ENV_LOCK;
5050+
ENV_READ_LOCK;
50515051
tpath = tempnam(p, "pltmp");
50525052
if (str && tpath) {
50535053
strcpy(str, tpath);
5054-
ENV_UNLOCK;
5054+
ENV_READ_UNLOCK;
50555055
return str;
50565056
}
5057-
ENV_UNLOCK;
5057+
ENV_READ_UNLOCK;
50585058
return tpath;
50595059
}
50605060

0 commit comments

Comments
 (0)