From owner-cvs-all Tue Mar 5 9:34:41 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2F31137B400; Tue, 5 Mar 2002 09:34:37 -0800 (PST) Received: (from tegge@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g25HYbZ13632; Tue, 5 Mar 2002 09:34:37 -0800 (PST) (envelope-from tegge) Message-Id: <200203051734.g25HYbZ13632@freefall.freebsd.org> From: Tor Egge Date: Tue, 5 Mar 2002 09:34:37 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc/stdlib atexit.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG tegge 2002/03/05 09:34:37 PST Modified files: lib/libc/stdlib atexit.c Log: When multiple threads call atexit at the same time, some operations must be serialized. A mutex is used to protect the critical regions. sbrk() and brk() are not thread safe. Replace use of sbrk() with a call to malloc to avoid race when one thread calls atexit while another thread calls malloc. Reviewed by: deischen Revision Changes Path 1.4 +28 -2 src/lib/libc/stdlib/atexit.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message