From 192136b3f41e4b828529080beee9fe1c3cc39191 Mon Sep 17 00:00:00 2001 From: arvinzzz Date: Thu, 30 Dec 2021 16:56:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20DEFINE=5FMUTEX=E5=AE=8F=E4=B8=8Elinux?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在定义变量之后进行赋值初始化 close: #I4NOFQ Signed-off-by: arvinzzz Change-Id: Iff3ff2856f4a75204224970a7b1a702222abdb99 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index ca1c1ee..a4b731e 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -497,7 +497,7 @@ struct file_operations { #define simple_strtol strtol #define do_gettimeofday(a) gettimeofday(a, NULL) -#define DEFINE_MUTEX(m) pthread_mutex_t m; +#define DEFINE_MUTEX(m) pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; #define mutex_lock pthread_mutex_lock #define mutex_unlock pthread_mutex_unlock #define mutex_init(m) pthread_mutex_init(m, NULL) -- GitLab