summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-07-06 10:18:48 +0000
committermtm <mtm@FreeBSD.org>2003-07-06 10:18:48 +0000
commit2ced154094b1ba76e51108eff45803f60f6731ce (patch)
tree314e5a3ea0c37ba2ab164337eae32bb02e9f5383 /lib/libthr
parentd4808894e4846559ec5d35948da89927a1034b33 (diff)
downloadFreeBSD-src-2ced154094b1ba76e51108eff45803f60f6731ce.zip
FreeBSD-src-2ced154094b1ba76e51108eff45803f60f6731ce.tar.gz
Change all instances of THR_LOCK/UNLOCK, etc to UMTX_*.
It is a more acurate description of the locks they operate on.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_cancel.c4
-rw-r--r--lib/libthr/thread/thr_detach.c6
-rw-r--r--lib/libthr/thread/thr_exit.c4
-rw-r--r--lib/libthr/thread/thr_gc.c6
-rw-r--r--lib/libthr/thread/thr_join.c12
-rw-r--r--lib/libthr/thread/thr_kern.c4
-rw-r--r--lib/libthr/thread/thr_mutex.c4
-rw-r--r--lib/libthr/thread/thr_private.h6
8 files changed, 23 insertions, 23 deletions
diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c
index 180607c..d27b4b3 100644
--- a/lib/libthr/thread/thr_cancel.c
+++ b/lib/libthr/thread/thr_cancel.c
@@ -80,13 +80,13 @@ retry:
* Disconnect the thread from the joinee:
*/
if ((joined = pthread->join_status.thread) != NULL) {
- THR_TRYLOCK(&joined->lock, ret);
+ UMTX_TRYLOCK(&joined->lock, ret);
if (ret == EBUSY) {
_thread_critical_exit(pthread);
goto retry;
}
pthread->join_status.thread->joiner = NULL;
- THR_UNLOCK(&joined->lock);
+ UMTX_UNLOCK(&joined->lock);
joined = pthread->join_status.thread = NULL;
}
pthread->cancelflags |= PTHREAD_CANCELLING;
diff --git a/lib/libthr/thread/thr_detach.c b/lib/libthr/thread/thr_detach.c
index 6161e86..a2ad4d4 100644
--- a/lib/libthr/thread/thr_detach.c
+++ b/lib/libthr/thread/thr_detach.c
@@ -44,10 +44,10 @@ _pthread_detach(pthread_t pthread)
if (pthread == NULL || pthread->magic != PTHREAD_MAGIC)
return (EINVAL);
- THR_LOCK(&pthread->lock);
+ UMTX_LOCK(&pthread->lock);
if (pthread->attr.flags & PTHREAD_DETACHED) {
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
return (EINVAL);
}
@@ -73,7 +73,7 @@ _pthread_detach(pthread_t pthread)
_thread_critical_exit(joiner);
}
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
return (0);
}
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c
index 441e730..facd707 100644
--- a/lib/libthr/thread/thr_exit.c
+++ b/lib/libthr/thread/thr_exit.c
@@ -146,7 +146,7 @@ retry:
/* Check if there is a thread joining this one: */
if (curthread->joiner != NULL) {
pthread = curthread->joiner;
- THR_LOCK(&pthread->lock);
+ UMTX_LOCK(&pthread->lock);
curthread->joiner = NULL;
/* Make the joining thread runnable: */
@@ -156,7 +156,7 @@ retry:
pthread->join_status.ret = curthread->ret;
pthread->join_status.error = 0;
pthread->join_status.thread = NULL;
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
/* Make this thread collectable by the garbage collector. */
PTHREAD_ASSERT(((curthread->attr.flags & PTHREAD_DETACHED) ==
diff --git a/lib/libthr/thread/thr_gc.c b/lib/libthr/thread/thr_gc.c
index 0948996..1f6bc6b 100644
--- a/lib/libthr/thread/thr_gc.c
+++ b/lib/libthr/thread/thr_gc.c
@@ -106,7 +106,7 @@ _thread_gc(pthread_addr_t arg)
if (pthread == _thread_initial)
continue;
- THR_LOCK(&pthread->lock);
+ UMTX_LOCK(&pthread->lock);
/*
* Check if the stack was not specified by
@@ -128,7 +128,7 @@ _thread_gc(pthread_addr_t arg)
* it on the dead thread list.
*/
if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) {
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
continue;
}
@@ -141,7 +141,7 @@ _thread_gc(pthread_addr_t arg)
*/
pthread_cln = pthread;
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
/*
* Retire the architecture specific id so it may be
diff --git a/lib/libthr/thread/thr_join.c b/lib/libthr/thread/thr_join.c
index ed03367..30acc93 100644
--- a/lib/libthr/thread/thr_join.c
+++ b/lib/libthr/thread/thr_join.c
@@ -70,7 +70,7 @@ _pthread_join(pthread_t pthread, void **thread_return)
THREAD_LIST_LOCK;
TAILQ_FOREACH(thread, &_thread_list, tle)
if (thread == pthread) {
- THR_LOCK(&pthread->lock);
+ UMTX_LOCK(&pthread->lock);
break;
}
@@ -80,7 +80,7 @@ _pthread_join(pthread_t pthread, void **thread_return)
*/
TAILQ_FOREACH(thread, &_dead_list, dle)
if (thread == pthread) {
- THR_LOCK(&pthread->lock);
+ UMTX_LOCK(&pthread->lock);
break;
}
@@ -88,7 +88,7 @@ _pthread_join(pthread_t pthread, void **thread_return)
if (thread == NULL ||
((pthread->attr.flags & PTHREAD_DETACHED) != 0)) {
if (thread != NULL)
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
THREAD_LIST_UNLOCK;
DEAD_LIST_UNLOCK;
ret = ESRCH;
@@ -98,7 +98,7 @@ _pthread_join(pthread_t pthread, void **thread_return)
if (pthread->joiner != NULL) {
/* Multiple joiners are not supported. */
/* XXXTHR - support multiple joiners. */
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
THREAD_LIST_UNLOCK;
DEAD_LIST_UNLOCK;
ret = ENOTSUP;
@@ -110,7 +110,7 @@ _pthread_join(pthread_t pthread, void **thread_return)
if (pthread->state != PS_DEAD) {
/* Set the running thread to be the joiner: */
pthread->joiner = curthread;
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
_thread_critical_enter(curthread);
/* Keep track of which thread we're joining to: */
@@ -162,7 +162,7 @@ _pthread_join(pthread_t pthread, void **thread_return)
/* Make the thread collectable by the garbage collector. */
pthread->attr.flags |= PTHREAD_DETACHED;
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
THREAD_LIST_UNLOCK;
if (pthread_cond_signal(&_gc_cond) != 0)
PANIC("Cannot signal gc cond");
diff --git a/lib/libthr/thread/thr_kern.c b/lib/libthr/thread/thr_kern.c
index 481cc83..b3dae7d 100644
--- a/lib/libthr/thread/thr_kern.c
+++ b/lib/libthr/thread/thr_kern.c
@@ -56,13 +56,13 @@ void
_thread_critical_enter(pthread_t pthread)
{
_thread_sigblock();
- THR_LOCK(&pthread->lock);
+ UMTX_LOCK(&pthread->lock);
}
void
_thread_critical_exit(pthread_t pthread)
{
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
_thread_sigunblock();
}
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index e47fb60..722772b 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -1291,9 +1291,9 @@ _mutex_lock_backout(pthread_t pthread)
/* _thread_kern_sig_defer();*/
/* XXX - Necessary to obey lock order */
- THR_LOCK(&pthread->lock);
+ UMTX_LOCK(&pthread->lock);
mutex = pthread->data.mutex;
- THR_UNLOCK(&pthread->lock);
+ UMTX_UNLOCK(&pthread->lock);
_SPINLOCK(&mutex->lock);
diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h
index 9b118b9..3260c9b 100644
--- a/lib/libthr/thread/thr_private.h
+++ b/lib/libthr/thread/thr_private.h
@@ -83,20 +83,20 @@
/*
* Locking macros
*/
-#define THR_LOCK(m) \
+#define UMTX_LOCK(m) \
do { \
if (umtx_lock((m), curthread->thr_id) != 0) \
abort(); \
} while (0)
-#define THR_TRYLOCK(m, r) \
+#define UMTX_TRYLOCK(m, r) \
do { \
(r) = umtx_trylock((m), curthread->thr_id); \
if ((r) != 0 && (r) != EBUSY) \
abort(); \
} while (0)
-#define THR_UNLOCK(m) \
+#define UMTX_UNLOCK(m) \
do { \
if (umtx_unlock((m), curthread->thr_id) != 0) \
abort(); \
OpenPOWER on IntegriCloud