diff options
Diffstat (limited to 'lib/libthr/thread/thr_spinlock.c')
-rw-r--r-- | lib/libthr/thread/thr_spinlock.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libthr/thread/thr_spinlock.c b/lib/libthr/thread/thr_spinlock.c index 6639612..51903a6 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"); } |