libthr: const-ify two variables

Make the default umutex and urwlock initializers const,
because they can be, and as a microoptimization.

MFC after:	5 days
Sponsored by:	Dell Inc.
This commit is contained in:
Eric van Gyzen 2016-01-13 22:34:55 +00:00
parent 216818a1bb
commit 8e402f34b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293858

View File

@ -42,7 +42,7 @@ int _umtx_op_err(void *obj, int op, u_long val, void *uaddr, void *uaddr2)
void
_thr_umutex_init(struct umutex *mtx)
{
static struct umutex default_mtx = DEFAULT_UMUTEX;
static const struct umutex default_mtx = DEFAULT_UMUTEX;
*mtx = default_mtx;
}
@ -50,7 +50,8 @@ _thr_umutex_init(struct umutex *mtx)
void
_thr_urwlock_init(struct urwlock *rwl)
{
static struct urwlock default_rwl = DEFAULT_URWLOCK;
static const struct urwlock default_rwl = DEFAULT_URWLOCK;
*rwl = default_rwl;
}