4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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.
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]
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
32 * Stubs for the standalone to reduce the dependence on external libraries
40 cond_init(cond_t
*cvp
, int type
, void *arg
)
47 cond_destroy(cond_t
*cvp
)
54 cond_wait(cond_t
*cv
, mutex_t
*mutex
)
56 umem_panic("attempt to wait on standumem cv %p", cv
);
64 cond_broadcast(cond_t
*cvp
)
71 pthread_setcancelstate(int state
, int *oldstate
)
82 static mutex_t _mp
= DEFAULTMUTEX
;
86 mutex_init(mutex_t
*mp
, int type
, void *arg
)
88 (void) memcpy(mp
, &_mp
, sizeof (mutex_t
));
94 mutex_destroy(mutex_t
*mp
)
101 _mutex_held(void *mp
)
108 mutex_lock(mutex_t
*mp
)
115 mutex_trylock(mutex_t
*mp
)
122 mutex_unlock(mutex_t
*mp
)
134 _tmem_get_nentries(void)
147 _tmem_set_cleanup(void (*f
)(int, void *))