Deleted Added
full compact
thr_mutex.c (54708) thr_mutex.c (55838)
1/*
2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
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

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

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*
2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
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

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

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/lib/libkse/thread/thr_mutex.c 54708 1999-12-17 00:57:54Z deischen $
32 * $FreeBSD: head/lib/libkse/thread/thr_mutex.c 55838 2000-01-12 09:28:58Z jasone $
33 */
34#include <stdlib.h>
35#include <errno.h>
36#include <string.h>
37#include <sys/param.h>
38#include <sys/queue.h>
39#ifdef _THREAD_SAFE
40#include <pthread.h>

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

238 }
239 }
240
241 /* Return the completion status: */
242 return (ret);
243}
244
245static int
33 */
34#include <stdlib.h>
35#include <errno.h>
36#include <string.h>
37#include <sys/param.h>
38#include <sys/queue.h>
39#ifdef _THREAD_SAFE
40#include <pthread.h>

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

238 }
239 }
240
241 /* Return the completion status: */
242 return (ret);
243}
244
245static int
246init_static (pthread_mutex_t *mutex)
246init_static(pthread_mutex_t *mutex)
247{
248 int ret;
249
250 _SPINLOCK(&static_init_lock);
251
252 if (*mutex == NULL)
253 ret = pthread_mutex_init(mutex, NULL);
254 else

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

1214 }
1215 else
1216 /* We're done: */
1217 m = NULL;
1218 }
1219}
1220
1221static void
247{
248 int ret;
249
250 _SPINLOCK(&static_init_lock);
251
252 if (*mutex == NULL)
253 ret = pthread_mutex_init(mutex, NULL);
254 else

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

1214 }
1215 else
1216 /* We're done: */
1217 m = NULL;
1218 }
1219}
1220
1221static void
1222mutex_rescan_owned (pthread_t pthread, pthread_mutex_t mutex)
1222mutex_rescan_owned(pthread_t pthread, pthread_mutex_t mutex)
1223{
1224 int active_prio, inherited_prio;
1225 pthread_mutex_t m;
1226 pthread_t pthread_next;
1227
1228 /*
1229 * Start walking the mutexes the thread has taken since
1230 * taking this mutex.

--- 176 unchanged lines hidden ---
1223{
1224 int active_prio, inherited_prio;
1225 pthread_mutex_t m;
1226 pthread_t pthread_next;
1227
1228 /*
1229 * Start walking the mutexes the thread has taken since
1230 * taking this mutex.

--- 176 unchanged lines hidden ---