From a032a6587011cbdac8c2f7e11f15dc4e592bbb55 Mon Sep 17 00:00:00 2001 From: Austin Foxley Date: Tue, 16 Feb 2010 12:27:18 -0800 Subject: mass sync with glibc nptl Signed-off-by: Austin Foxley --- libpthread/nptl/sem_init.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'libpthread/nptl/sem_init.c') diff --git a/libpthread/nptl/sem_init.c b/libpthread/nptl/sem_init.c index 1439bd053..0a224f3ad 100644 --- a/libpthread/nptl/sem_init.c +++ b/libpthread/nptl/sem_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -21,6 +21,7 @@ #include #include #include "semaphoreP.h" +#include int @@ -37,13 +38,18 @@ __new_sem_init ( } /* Map to the internal type. */ - struct sem *isem = (struct sem *) sem; - - /* Use the value the user provided. */ - isem->count = value; - - /* We can completely ignore the PSHARED parameter since inter-process - use needs no special preparation. */ + struct new_sem *isem = (struct new_sem *) sem; + + /* Use the values the user provided. */ + isem->value = value; +#ifdef __ASSUME_PRIVATE_FUTEX + isem->private = pshared ? 0 : FUTEX_PRIVATE_FLAG; +#else + isem->private = pshared ? 0 : THREAD_GETMEM (THREAD_SELF, + header.private_futex); +#endif + + isem->nwaiters = 0; return 0; } -- cgit v1.2.3