summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2006-01-12 07:28:21 +0000
committerjasone <jasone@FreeBSD.org>2006-01-12 07:28:21 +0000
commit3668a2e4940ebe0e7c33729ad375a9a7b0c6ceb1 (patch)
tree25770955017440672d2cba68e6d8c382b53d9f75 /lib/libpthread
parent40e5b400fdbcc7db744cb07d18d2c5dcfdb6fd18 (diff)
downloadFreeBSD-src-3668a2e4940ebe0e7c33729ad375a9a7b0c6ceb1.zip
FreeBSD-src-3668a2e4940ebe0e7c33729ad375a9a7b0c6ceb1.tar.gz
In preparation for a new malloc implementation:
* Add posix_memalign(). * Move calloc() from calloc.c to malloc.c. Add a calloc() implementation in rtld-elf in order to make the loader happy (even though calloc() isn't used in rtld-elf). * Add _malloc_prefork() and _malloc_postfork(), and use them instead of directly manipulating __malloc_lock. Approved by: phk, markm (mentor)
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_fork.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_fork.c b/lib/libpthread/thread/thr_fork.c
index fdbfd86..5445483 100644
--- a/lib/libpthread/thread/thr_fork.c
+++ b/lib/libpthread/thread/thr_fork.c
@@ -91,7 +91,7 @@ _fork(void)
/* Fork a new process: */
if (_kse_isthreaded() != 0) {
- _spinlock(__malloc_lock);
+ _malloc_prefork();
}
if ((ret = __sys_fork()) == 0) {
/* Child process */
@@ -107,8 +107,8 @@ _fork(void)
}
_thr_mutex_reinit(&_thr_atfork_mutex);
} else {
- if ((_kse_isthreaded() != 0) && (__malloc_lock != NULL)) {
- _spinunlock(__malloc_lock);
+ if (_kse_isthreaded() != 0) {
+ _malloc_postfork();
}
errsave = errno;
if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) {
OpenPOWER on IntegriCloud