summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_spinlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_spinlock.c')
-rw-r--r--lib/libthr/thread/thr_spinlock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_spinlock.c b/lib/libthr/thread/thr_spinlock.c
index 25f6337..b9d2279 100644
--- a/lib/libthr/thread/thr_spinlock.c
+++ b/lib/libthr/thread/thr_spinlock.c
@@ -65,7 +65,7 @@ static void init_spinlock(spinlock_t *lck);
void
_spinunlock(spinlock_t *lck)
{
- THR_UMTX_UNLOCK(_get_curthread(), (umtx_t *)&lck->access_lock);
+ THR_UMTX_UNLOCK(_get_curthread(), (volatile umtx_t *)&lck->access_lock);
}
void
@@ -77,11 +77,11 @@ _spinlock(spinlock_t *lck)
PANIC("Spinlocks not initialized.");
if (lck->fname == NULL)
init_spinlock(lck);
- THR_UMTX_LOCK(_get_curthread(), (umtx_t *)&lck->access_lock);
+ THR_UMTX_LOCK(_get_curthread(), (volatile umtx_t *)&lck->access_lock);
}
void
-_spinlock_debug(spinlock_t *lck, char *fname, int lineno)
+_spinlock_debug(spinlock_t *lck, char *fname __unused, int lineno __unused)
{
_spinlock(lck);
}
@@ -118,7 +118,8 @@ _thr_spinlock_init(void)
* it is better to do pthread_atfork in libc.
*/
for (i = 0; i < spinlock_count; i++)
- _thr_umtx_init((umtx_t *)&extra[i].owner->access_lock);
+ _thr_umtx_init((volatile umtx_t *)
+ &extra[i].owner->access_lock);
} else {
initialized = 1;
}
OpenPOWER on IntegriCloud