aboutsummaryrefslogtreecommitdiff
path: root/lib/libthr/thread
diff options
context:
space:
mode:
authorEric van Gyzen <vangyzen@FreeBSD.org>2017-05-20 17:32:01 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2017-05-20 17:32:01 +0000
commit07f29d9f76cf7c3879c223ae0a7d7d5fab3bfd2c (patch)
treea086b650930e6fe35c7ef8227d3ebbcbef5f6169 /lib/libthr/thread
parent048ad6aedc567bb37c43b069eb38bb9784a800e2 (diff)
Notes
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r--lib/libthr/thread/thr_init.c1
-rw-r--r--lib/libthr/thread/thr_spinlock.c12
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index e5393c05f2c5d..909f14236d172 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -173,7 +173,6 @@ STATIC_LIB_REQUIRE(_sigtimedwait);
STATIC_LIB_REQUIRE(_sigwait);
STATIC_LIB_REQUIRE(_sigwaitinfo);
STATIC_LIB_REQUIRE(_spinlock);
-STATIC_LIB_REQUIRE(_spinlock_debug);
STATIC_LIB_REQUIRE(_spinunlock);
STATIC_LIB_REQUIRE(_thread_init_hack);
diff --git a/lib/libthr/thread/thr_spinlock.c b/lib/libthr/thread/thr_spinlock.c
index 66396123d2e9d..51903a6948c95 100644
--- a/lib/libthr/thread/thr_spinlock.c
+++ b/lib/libthr/thread/thr_spinlock.c
@@ -65,7 +65,7 @@ __thr_spinunlock(spinlock_t *lck)
{
struct spinlock_extra *_extra;
- _extra = (struct spinlock_extra *)lck->fname;
+ _extra = lck->thr_extra;
THR_UMUTEX_UNLOCK(_get_curthread(), &_extra->lock);
}
@@ -78,9 +78,9 @@ __thr_spinlock(spinlock_t *lck)
PANIC("Spinlock called when not threaded.");
if (!initialized)
PANIC("Spinlocks not initialized.");
- if (lck->fname == NULL)
+ if (lck->thr_extra == NULL)
init_spinlock(lck);
- _extra = (struct spinlock_extra *)lck->fname;
+ _extra = lck->thr_extra;
THR_UMUTEX_LOCK(_get_curthread(), &_extra->lock);
}
@@ -90,14 +90,14 @@ init_spinlock(spinlock_t *lck)
struct pthread *curthread = _get_curthread();
THR_UMUTEX_LOCK(curthread, &spinlock_static_lock);
- if ((lck->fname == NULL) && (spinlock_count < MAX_SPINLOCKS)) {
- lck->fname = (char *)&extra[spinlock_count];
+ if ((lck->thr_extra == NULL) && (spinlock_count < MAX_SPINLOCKS)) {
+ lck->thr_extra = &extra[spinlock_count];
_thr_umutex_init(&extra[spinlock_count].lock);
extra[spinlock_count].owner = lck;
spinlock_count++;
}
THR_UMUTEX_UNLOCK(curthread, &spinlock_static_lock);
- if (lck->fname == NULL)
+ if (lck->thr_extra == NULL)
PANIC("Warning: exceeded max spinlocks");
}