diff options
author | Austin Foxley <austinf@cetoncorp.com> | 2010-02-16 12:27:18 -0800 |
---|---|---|
committer | Austin Foxley <austinf@cetoncorp.com> | 2010-02-16 12:27:18 -0800 |
commit | a032a6587011cbdac8c2f7e11f15dc4e592bbb55 (patch) | |
tree | b8d8dfc6abf0168e098223c2134a3e4bd7640942 /libpthread/nptl/sem_init.c | |
parent | 70f1d42b13a741f603472f405299e5d2938aa728 (diff) |
mass sync with glibc nptl
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libpthread/nptl/sem_init.c')
-rw-r--r-- | libpthread/nptl/sem_init.c | 22 |
1 files changed, 14 insertions, 8 deletions
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 <drepper@redhat.com>, 2002. @@ -21,6 +21,7 @@ #include <semaphore.h> #include <lowlevellock.h> #include "semaphoreP.h" +#include <bits/kernel-features.h> 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; } |