summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_turnstile.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-10-02 20:31:47 +0000
committerjhb <jhb@FreeBSD.org>2002-10-02 20:31:47 +0000
commit8c9a393a0433c7cc2ee90541164cdcb927fa5bdb (patch)
tree4e540e60eb5d2ee3fc581a4014df11fe04763455 /sys/kern/subr_turnstile.c
parentf4c70e659ffb00b8f69da48f3d5a0e5bb540f8cb (diff)
downloadFreeBSD-src-8c9a393a0433c7cc2ee90541164cdcb927fa5bdb.zip
FreeBSD-src-8c9a393a0433c7cc2ee90541164cdcb927fa5bdb.tar.gz
Rename the mutex thread and process states to use a more generic 'LOCK'
name instead. (e.g., SLOCK instead of SMTX, TD_ON_LOCK() instead of TD_ON_MUTEX()) Eventually a turnstile abstraction will be added that will be shared with mutexes and other types of locks. SLOCK/TDI_LOCK will be used internally by the turnstile code and will not be specific to mutexes. Making the change now ensures that turnstiles can be dropped in at a later date without affecting the ABI of userland applications.
Diffstat (limited to 'sys/kern/subr_turnstile.c')
-rw-r--r--sys/kern/subr_turnstile.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c
index 6becc78..e60d805 100644
--- a/sys/kern/subr_turnstile.c
+++ b/sys/kern/subr_turnstile.c
@@ -163,7 +163,7 @@ propagate_priority(struct thread *td)
/*
* If we aren't blocked on a mutex, we should be.
*/
- KASSERT(TD_ON_MUTEX(td), (
+ KASSERT(TD_ON_LOCK(td), (
"process %d(%s):%d holds %s but isn't blocked on a mutex\n",
td->td_proc->p_pid, td->td_proc->p_comm, td->td_state,
m->mtx_object.lo_name));
@@ -182,7 +182,7 @@ propagate_priority(struct thread *td)
continue;
}
- td1 = TAILQ_PREV(td, threadqueue, td_blkq);
+ td1 = TAILQ_PREV(td, threadqueue, td_lockq);
if (td1->td_priority <= pri) {
continue;
}
@@ -194,15 +194,15 @@ propagate_priority(struct thread *td)
* thread in the chain has a lower priority and that
* td1 will thus not be NULL after the loop.
*/
- TAILQ_REMOVE(&m->mtx_blocked, td, td_blkq);
- TAILQ_FOREACH(td1, &m->mtx_blocked, td_blkq) {
+ TAILQ_REMOVE(&m->mtx_blocked, td, td_lockq);
+ TAILQ_FOREACH(td1, &m->mtx_blocked, td_lockq) {
MPASS(td1->td_proc->p_magic == P_MAGIC);
if (td1->td_priority > pri)
break;
}
MPASS(td1 != NULL);
- TAILQ_INSERT_BEFORE(td1, td, td_blkq);
+ TAILQ_INSERT_BEFORE(td1, td, td_lockq);
CTR4(KTR_LOCK,
"propagate_priority: p %p moved before %p on [%p] %s",
td, td1, m, m->mtx_object.lo_name);
@@ -591,15 +591,15 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line)
if (TAILQ_EMPTY(&m->mtx_blocked)) {
td1 = mtx_owner(m);
LIST_INSERT_HEAD(&td1->td_contested, m, mtx_contested);
- TAILQ_INSERT_TAIL(&m->mtx_blocked, td, td_blkq);
+ TAILQ_INSERT_TAIL(&m->mtx_blocked, td, td_lockq);
} else {
- TAILQ_FOREACH(td1, &m->mtx_blocked, td_blkq)
+ TAILQ_FOREACH(td1, &m->mtx_blocked, td_lockq)
if (td1->td_priority > td->td_priority)
break;
if (td1)
- TAILQ_INSERT_BEFORE(td1, td, td_blkq);
+ TAILQ_INSERT_BEFORE(td1, td, td_lockq);
else
- TAILQ_INSERT_TAIL(&m->mtx_blocked, td, td_blkq);
+ TAILQ_INSERT_TAIL(&m->mtx_blocked, td, td_lockq);
}
#ifdef KTR
if (!cont_logged) {
@@ -616,8 +616,8 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line)
* Save who we're blocked on.
*/
td->td_blocked = m;
- td->td_mtxname = m->mtx_object.lo_name;
- TD_SET_MUTEX(td);
+ td->td_lockname = m->mtx_object.lo_name;
+ TD_SET_LOCK(td);
propagate_priority(td);
if (LOCK_LOG_TEST(&m->mtx_object, opts))
@@ -735,7 +735,7 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line)
MPASS(td->td_proc->p_magic == P_MAGIC);
MPASS(td1->td_proc->p_magic == P_MAGIC);
- TAILQ_REMOVE(&m->mtx_blocked, td1, td_blkq);
+ TAILQ_REMOVE(&m->mtx_blocked, td1, td_lockq);
if (TAILQ_EMPTY(&m->mtx_blocked)) {
LIST_REMOVE(m, mtx_contested);
@@ -761,7 +761,7 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line)
m, td1);
td1->td_blocked = NULL;
- TD_CLR_MUTEX(td1);
+ TD_CLR_LOCK(td1);
if (!TD_CAN_RUN(td1)) {
mtx_unlock_spin(&sched_lock);
return;
OpenPOWER on IntegriCloud