synch.h (211975) | synch.h (214274) |
---|---|
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 * | 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 211975 2010-08-29 21:37:21Z pjd $ | 29 * $FreeBSD: head/sbin/hastd/synch.h 214274 2010-10-24 15:41:23Z pjd $ |
30 */ 31 32#ifndef _SYNCH_H_ 33#define _SYNCH_H_ 34 35#include <assert.h> 36#include <errno.h> 37#include <pthread.h> --- 97 unchanged lines hidden (view full) --- 135 int error; 136 137 error = pthread_condattr_init(&attr); 138 assert(error == 0); 139 error = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); 140 assert(error == 0); 141 error = pthread_cond_init(cv, &attr); 142 assert(error == 0); | 30 */ 31 32#ifndef _SYNCH_H_ 33#define _SYNCH_H_ 34 35#include <assert.h> 36#include <errno.h> 37#include <pthread.h> --- 97 unchanged lines hidden (view full) --- 135 int error; 136 137 error = pthread_condattr_init(&attr); 138 assert(error == 0); 139 error = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); 140 assert(error == 0); 141 error = pthread_cond_init(cv, &attr); 142 assert(error == 0); |
143 error = pthread_condattr_destroy(&attr); 144 assert(error == 0); |
|
143} 144static __inline void 145cv_wait(pthread_cond_t *cv, pthread_mutex_t *lock) 146{ 147 int error; 148 149 error = pthread_cond_wait(cv, lock); 150 assert(error == 0); --- 36 unchanged lines hidden --- | 145} 146static __inline void 147cv_wait(pthread_cond_t *cv, pthread_mutex_t *lock) 148{ 149 int error; 150 151 error = pthread_cond_wait(cv, lock); 152 assert(error == 0); --- 36 unchanged lines hidden --- |