diff options
author | jasone <jasone@FreeBSD.org> | 1999-07-11 05:56:37 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 1999-07-11 05:56:37 +0000 |
commit | d1e30ddcd16d4d7217ba77db099fe1c9bbe85803 (patch) | |
tree | 3908ace46508aeb3c84794ab51e089a5ab6a9050 /lib/libc_r/uthread/uthread_init.c | |
parent | f687757a7c174d7f844f10cb815bdcc00a2632ff (diff) | |
download | FreeBSD-src-d1e30ddcd16d4d7217ba77db099fe1c9bbe85803.zip FreeBSD-src-d1e30ddcd16d4d7217ba77db099fe1c9bbe85803.tar.gz |
Modify previous changes to conform better to libc_r's coding style.
Always use mmap() for default-size stack allocation. Use MAP_ANON instead
of MAP_STACK on the alpha architecture.
Reduce the amount of code executed while owning _gc_mutex during stack
allocation.
Diffstat (limited to 'lib/libc_r/uthread/uthread_init.c')
-rw-r--r-- | lib/libc_r/uthread/uthread_init.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_init.c b/lib/libc_r/uthread/uthread_init.c index a5b7a82..f5e2c45 100644 --- a/lib/libc_r/uthread/uthread_init.c +++ b/lib/libc_r/uthread/uthread_init.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: uthread_init.c,v 1.13 1999/07/05 00:35:19 jasone Exp $ + * $Id: uthread_init.c,v 1.14 1999/07/06 00:25:38 jasone Exp $ */ /* Allocate space for global thread variables here: */ @@ -180,15 +180,17 @@ _thread_init(void) /* Initialize the scheduling switch hook routine: */ _sched_switch_hook = NULL; -#ifdef __i386__ /* Initialize the thread stack cache: */ SLIST_INIT(&_stackq); /* Create the red zone for the main stack. */ - if (MAP_FAILED == mmap((void *) PTHREAD_STACK_TOP - PTHREAD_STACK_INITIAL, PTHREAD_STACK_GUARD, 0, MAP_ANON, -1, 0)) { + if (mmap((void *) PTHREAD_STACK_TOP + - PTHREAD_STACK_INITIAL, + PTHREAD_STACK_GUARD, 0, MAP_ANON, + -1, 0) == MAP_FAILED) { PANIC("Cannot allocate red zone for initial thread"); } -#endif + /* * Write a magic value to the thread structure * to help identify valid ones: |