[libc-commits] [libc] [libc][stdlib] Remove LIBC_THREAD_LOCAL from rand_next (PR #96245)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Thu Jun 20 16:39:55 PDT 2024
SchrodingerZhu wrote:
**Thread-safety**
All interfaces defined by this specification will be thread-safe, except that the following interfaces need not be thread-safe:
POSIX Interfaces
[asctime()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/asctime.html)
[ctime()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/ctime.html)
[getc_unlocked()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getc_unlocked.html)
[getchar_unlocked()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getchar_unlocked.html)
[getgrgid()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getgrgid.html)
[getgrnam()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getgrnam.html)
[getlogin()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getlogin.html)
[getopt()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getopt.html)
[getpwnam()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getpwnam.html)
[getpwuid()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getpwuid.html)
[gmtime()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/gmtime.html)
[localtime()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/localtime.html)
[putc_unlocked()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/putc_unlocked.html)
[putchar_unlocked()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/putchar_unlocked.html)
[rand()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/rand.html)
[readdir()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/readdir.html)
[strtok()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/strtok.html)
[ttyname()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/ttyname.html)
X/Open Interfaces
[basename()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/basename.html)
[catgets()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/catgets.html)
[dbm_clearerr()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_clearerr.html)
[dbm_close()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_close.html)
[dbm_delete()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_delete.html)
[dbm_error()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_error.html)
[dbm_fetch()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_fetch.html)
[dbm_firstkey()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_firstkey.html)
[dbm_nextkey()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_nextkey.html)
[dbm_open()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_open.html)
[dbm_store()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dbm_store.html)
[dirname()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/dirname.html)
[drand48()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/drand48.html)
[ecvt()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/ecvt.html)
[encrypt()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/encrypt.html)
[endgrent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/endgrent.html)
[endpwent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/endpwent.html)
[endutxent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/endutxent.html)
[fcvt()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/fcvt.html)
[gamma()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/gamma.html)
[gcvt()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/gcvt.html)
[getdate()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getdate.html)
[getenv()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getenv.html)
[getgrent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getgrent.html)
[getpwent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getpwent.html)
[getutxent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getutxent.html)
[getutxid()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getutxid.html)
[getutxline()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getutxline.html)
[getw()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/getw.html)
[l64a()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/l64a.html)
[lgamma()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/lgamma.html)
[lrand48()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/lrand48.html)
[mrand48()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/mrand48.html)
[nl_langinfo()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/nl_langinfo.html)
[ptsname()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/ptsname.html)
[putenv()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/putenv.html)
[pututxline()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/pututxline.html)
[setgrent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/setgrent.html)
[setkey()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/setkey.html)
[setpwent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/setpwent.html)
[setutxent()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/setutxent.html)
[strerror()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/strerror.html)
The interfaces [ctermid()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/ctermid.html) and [tmpnam()](https://pubs.opengroup.org/onlinepubs/007908799/xsh/tmpnam.html) need not be thread-safe if passed a NULL argument.
The interfaces in the Legacy Feature Group need not be thread-safe.
Implementations will provide internal synchronisation as necessary in order to satisfy this requirement.
https://github.com/llvm/llvm-project/pull/96245
More information about the libc-commits
mailing list