thr_umtx.c (212076) | thr_umtx.c (212077) |
---|---|
1/* 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/* 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/lib/libthr/thread/thr_umtx.c 212076 2010-09-01 02:18:33Z davidxu $ | 26 * $FreeBSD: head/lib/libthr/thread/thr_umtx.c 212077 2010-09-01 03:11:21Z davidxu $ |
27 * 28 */ 29 30#include "thr_private.h" 31#include "thr_umtx.h" 32 33#ifndef HAS__UMTX_OP_ERR 34int _umtx_op_err(void *obj, int op, u_long val, void *uaddr, void *uaddr2) --- 7 unchanged lines hidden (view full) --- 42void 43_thr_umutex_init(struct umutex *mtx) 44{ 45 static struct umutex default_mtx = DEFAULT_UMUTEX; 46 47 *mtx = default_mtx; 48} 49 | 27 * 28 */ 29 30#include "thr_private.h" 31#include "thr_umtx.h" 32 33#ifndef HAS__UMTX_OP_ERR 34int _umtx_op_err(void *obj, int op, u_long val, void *uaddr, void *uaddr2) --- 7 unchanged lines hidden (view full) --- 42void 43_thr_umutex_init(struct umutex *mtx) 44{ 45 static struct umutex default_mtx = DEFAULT_UMUTEX; 46 47 *mtx = default_mtx; 48} 49 |
50void 51_thr_urwlock_init(struct urwlock *rwl) 52{ 53 static struct urwlock default_rwl = DEFAULT_URWLOCK; 54 *rwl = default_rwl; 55} 56 |
|
50int 51__thr_umutex_lock(struct umutex *mtx, uint32_t id) 52{ 53 uint32_t owner; 54 55 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { 56 for (;;) { 57 /* wait in kernel */ --- 201 unchanged lines hidden --- | 57int 58__thr_umutex_lock(struct umutex *mtx, uint32_t id) 59{ 60 uint32_t owner; 61 62 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { 63 for (;;) { 64 /* wait in kernel */ --- 201 unchanged lines hidden --- |