diff options
Diffstat (limited to 'cddl/contrib/opensolaris/head/synch.h')
-rw-r--r-- | cddl/contrib/opensolaris/head/synch.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/cddl/contrib/opensolaris/head/synch.h b/cddl/contrib/opensolaris/head/synch.h index eab9de8..89efe9c 100644 --- a/cddl/contrib/opensolaris/head/synch.h +++ b/cddl/contrib/opensolaris/head/synch.h @@ -20,15 +20,12 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _SYNCH_H #define _SYNCH_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * synch.h: * definitions needed to use the thread synchronization interface @@ -243,10 +240,17 @@ int sema_trywait(); #ifdef __STDC__ -int _sema_held(sema_t *); -int _rw_read_held(rwlock_t *); -int _rw_write_held(rwlock_t *); -int _mutex_held(mutex_t *); +/* + * The *_held() functions apply equally well to Solaris threads + * and to Posix threads synchronization objects, but the formal + * type declarations are different, so we just declare the argument + * to each *_held() function to be a void *, expecting that they will + * be called with the proper type of argument in each case. + */ +int _sema_held(void *); /* sema_t or sem_t */ +int _rw_read_held(void *); /* rwlock_t or pthread_rwlock_t */ +int _rw_write_held(void *); /* rwlock_t or pthread_rwlock_t */ +int _mutex_held(void *); /* mutex_t or pthread_mutex_t */ #else /* __STDC__ */ @@ -257,6 +261,13 @@ int _mutex_held(); #endif /* __STDC__ */ +/* Pause API */ +#ifdef __STDC__ +void smt_pause(void); +#else /* __STDC__ */ +void smt_pause(); +#endif /* __STDC__ */ + #endif /* _ASM */ #ifdef __cplusplus |