diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c index a8f6e24164d..5df19dc1bd4 100644 --- a/lib/libc/stdlib/exit.c +++ b/lib/libc/stdlib/exit.c @@ -41,6 +41,15 @@ static char sccsid[] = "@(#)exit.c 8.1 (Berkeley) 6/4/93"; void (*__cleanup)(); +/* + * This variable is zero until a process has created a thread. + * It is used to avoid calling locking functions in libc when they + * are not required. By default, libc is intended to be(come) + * thread-safe, but without a (significant) penalty to non-threaded + * processes. + */ +int __isthreaded = 0; + /* * Exit, flushing stdio buffers if necessary. */