fix:在非静态初始化条件下pthread_mutex_lock,没有经过init初始化就可以对已销毁的锁进行加锁

【背景】
 在非静态初始化条件下pthread_mutex_lock,没有经过init初始化就可以对已销毁的锁进行加锁

【修改方案】
 在pthread_mutex_destroy中将mutex的magic标记字段清除

 re #I4I7OA

 Signed-off-by: x-xiny <1301913191@qq.com>

Change-Id: I5d4cceff852e20e659a7cd06acf27cc6f381962c
This commit is contained in:
x-xiny 2021-11-15 06:47:03 +00:00
parent 09d972c9af
commit 9c8377fcc6
1 changed files with 1 additions and 0 deletions

View File

@ -134,6 +134,7 @@ int pthread_mutex_destroy(pthread_mutex_t *mutex)
return MapError(ret);
}
mutex->handle = _MUX_INVALID_HANDLE;
mutex->magic = 0;
return 0;
}