summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_rtld.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_rtld.c')
-rw-r--r--lib/libthr/thread/thr_rtld.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c
index d9041ad..e6af702 100644
--- a/lib/libthr/thread/thr_rtld.c
+++ b/lib/libthr/thread/thr_rtld.c
@@ -32,6 +32,7 @@
*/
#include <sys/cdefs.h>
#include <stdlib.h>
+#include <string.h>
#include "rtld_lock.h"
#include "thr_private.h"
@@ -132,7 +133,7 @@ _thr_rtld_wlock_acquire(void *lock)
SAVE_ERRNO();
l = (struct rtld_lock *)lock;
- _thr_signal_block(curthread);
+ THR_CRITICAL_ENTER(curthread);
while (_thr_rwlock_wrlock(&l->lock, NULL) != 0)
;
RESTORE_ERRNO();
@@ -152,12 +153,9 @@ _thr_rtld_lock_release(void *lock)
state = l->lock.rw_state;
if (_thr_rwlock_unlock(&l->lock) == 0) {
- if ((state & URWLOCK_WRITE_OWNER) == 0) {
+ if ((state & URWLOCK_WRITE_OWNER) == 0)
curthread->rdlock_count--;
- THR_CRITICAL_LEAVE(curthread);
- } else {
- _thr_signal_unblock(curthread);
- }
+ THR_CRITICAL_LEAVE(curthread);
}
RESTORE_ERRNO();
}
@@ -193,6 +191,9 @@ _thr_rtld_init(void)
/* force to resolve errno() PLT */
__error();
+ /* force to resolve memcpy PLT */
+ memcpy(&dummy, &dummy, sizeof(dummy));
+
li.lock_create = _thr_rtld_lock_create;
li.lock_destroy = _thr_rtld_lock_destroy;
li.rlock_acquire = _thr_rtld_rlock_acquire;
OpenPOWER on IntegriCloud