synch.h (7c478bd95313f5f23a4c958a745db2134aa03244) | synch.h (41efec2219526a9b3ecce26f97aba761ef1e1d0d) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the |
5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. | 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. |
8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ | 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ |
21 |
|
22/* | 22/* |
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved. | 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
24 * Use is subject to license terms. 25 */ 26 27#ifndef _SYNCH_H 28#define _SYNCH_H 29 30#pragma ident "%Z%%M% %I% %E% SMI" 31 --- 44 unchanged lines hidden (view full) --- 76 * Readers/writer locks 77 * 78 * NOTE: The layout of this structure should be kept in sync with the layout 79 * of the correponding structure of pthread_rwlock_t in sys/types.h. 80 * Also, there is an identical structure for lwp_rwlock_t in <sys/synch.h>. 81 * Because we have to deal with C++, we cannot redefine this one as that one. 82 */ 83typedef struct _rwlock { | 24 * Use is subject to license terms. 25 */ 26 27#ifndef _SYNCH_H 28#define _SYNCH_H 29 30#pragma ident "%Z%%M% %I% %E% SMI" 31 --- 44 unchanged lines hidden (view full) --- 76 * Readers/writer locks 77 * 78 * NOTE: The layout of this structure should be kept in sync with the layout 79 * of the correponding structure of pthread_rwlock_t in sys/types.h. 80 * Also, there is an identical structure for lwp_rwlock_t in <sys/synch.h>. 81 * Because we have to deal with C++, we cannot redefine this one as that one. 82 */ 83typedef struct _rwlock { |
84 int32_t readers; /* -1 == writer else # of readers */ | 84 int32_t readers; /* rwstate word */ |
85 uint16_t type; 86 uint16_t magic; | 85 uint16_t type; 86 uint16_t magic; |
87 mutex_t mutex; /* used to indicate ownership */ 88 cond_t readercv; /* unused */ 89 cond_t writercv; /* unused */ | 87 mutex_t mutex; /* used with process-shared rwlocks */ 88 cond_t readercv; /* used only to indicate ownership */ 89 cond_t writercv; /* used only to indicate ownership */ |
90} rwlock_t; 91 92#ifdef __STDC__ 93int _lwp_mutex_lock(lwp_mutex_t *); 94int _lwp_mutex_unlock(lwp_mutex_t *); 95int _lwp_mutex_trylock(lwp_mutex_t *); 96int _lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *); 97int _lwp_cond_timedwait(lwp_cond_t *, lwp_mutex_t *, timespec_t *); --- 167 unchanged lines hidden --- | 90} rwlock_t; 91 92#ifdef __STDC__ 93int _lwp_mutex_lock(lwp_mutex_t *); 94int _lwp_mutex_unlock(lwp_mutex_t *); 95int _lwp_mutex_trylock(lwp_mutex_t *); 96int _lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *); 97int _lwp_cond_timedwait(lwp_cond_t *, lwp_mutex_t *, timespec_t *); --- 167 unchanged lines hidden --- |