Initialize global mutext/sem by NXMUTEX_INITIALIZER and SEM_INITIALIZER

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
anjiahao
2022-09-06 14:18:45 +08:00
committed by Masayuki Ishikawa
parent 9f029194e1
commit d07792a343
225 changed files with 1930 additions and 2163 deletions
+4 -3
View File
@@ -72,7 +72,10 @@ struct wrbuffer_s
/* This is the state of the global write buffer resource */
static struct wrbuffer_s g_wrbuffer;
static struct wrbuffer_s g_wrbuffer =
{
SEM_INITIALIZER(CONFIG_NET_UDP_NWRBCHAINS)
};
/****************************************************************************
* Public Functions
@@ -99,8 +102,6 @@ void udp_wrbuffer_initialize(void)
{
sq_addfirst(&g_wrbuffer.buffers[i].wb_node, &g_wrbuffer.freebuffers);
}
nxsem_init(&g_wrbuffer.sem, 0, CONFIG_NET_UDP_NWRBCHAINS);
}
/****************************************************************************