From 810a6d8307c5ab9e91268ba6b0504331cc316f70 Mon Sep 17 00:00:00 2001 From: dhy308 Date: Mon, 7 Nov 2022 14:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=88=86=E9=85=8Dhandle=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=81=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dhy308 --- porting/linux/user/ldso/dynlink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/porting/linux/user/ldso/dynlink.c b/porting/linux/user/ldso/dynlink.c index 23f1eea3..a4a6c452 100644 --- a/porting/linux/user/ldso/dynlink.c +++ b/porting/linux/user/ldso/dynlink.c @@ -3018,6 +3018,8 @@ static void *dlopen_impl( return p; } + pthread_rwlock_wrlock(&lock); + p->nr_dlopen++; if (p->bfs_built) { for (int i = 0; p->deps[i]; i++) { @@ -3035,10 +3037,12 @@ static void *dlopen_impl( LD_LOGE("dlopen_impl: generate random handle failed"); do_dlclose(p); } + pthread_rwlock_unlock(&lock); return handle; #endif + pthread_rwlock_unlock(&lock); return p; } -- GitLab