Deleted Added
sdiff udiff text old ( 204076 ) new ( 211876 )
full compact
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Pawel Jakub Dawidek under sponsorship from
6 * the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sbin/hastd/synch.h 204076 2010-02-18 23:16:19Z pjd $
30 */
31
32#ifndef _SYNCH_H_
33#define _SYNCH_H_
34
35#include <assert.h>
36#include <pthread.h>
37#include <stdbool.h>
38#include <time.h>
39
40static __inline void
41mtx_init(pthread_mutex_t *lock)
42{
43 int error;
44

--- 20 unchanged lines hidden (view full) ---

65static __inline void
66mtx_unlock(pthread_mutex_t *lock)
67{
68 int error;
69
70 error = pthread_mutex_unlock(lock);
71 assert(error == 0);
72}
73
74static __inline void
75rw_init(pthread_rwlock_t *lock)
76{
77 int error;
78
79 error = pthread_rwlock_init(lock, NULL);
80 assert(error == 0);
81}

--- 81 unchanged lines hidden ---