diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 6f5347de215..d17a4465dbf 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -140,6 +140,7 @@ _thr_rtld_wlock_acquire(void *lock) THR_CRITICAL_ENTER(curthread); while (_thr_rwlock_wrlock(&l->lock, NULL) != 0) ; + l->lock.rw_wowner = TID(curthread); RESTORE_ERRNO(); } diff --git a/lib/libthr/thread/thr_umtx.h b/lib/libthr/thread/thr_umtx.h index 5dae304528d..9103f8d1d55 100644 --- a/lib/libthr/thread/thr_umtx.h +++ b/lib/libthr/thread/thr_umtx.h @@ -37,7 +37,7 @@ #else #define DEFAULT_UMUTEX {0,0,{0,0},0,0,{0,0}} #endif -#define DEFAULT_URWLOCK {0,0,0,0,{0,0,0,0}} +#define DEFAULT_URWLOCK {0,0,0,0,0,{0,0,0}} int _umtx_op_err(void *, int op, u_long, void *, void *) __hidden; int __thr_umutex_lock(struct umutex *mtx, uint32_t id) __hidden; diff --git a/sys/sys/_umtx.h b/sys/sys/_umtx.h index d94f86b0f56..3903f36db91 100644 --- a/sys/sys/_umtx.h +++ b/sys/sys/_umtx.h @@ -56,7 +56,8 @@ struct urwlock { __uint32_t rw_flags; __uint32_t rw_blocked_readers; __uint32_t rw_blocked_writers; - __uint32_t rw_spare[4]; + __uint32_t rw_wowner; + __uint32_t rw_spare[3]; }; struct _usem {