未验证 提交 d0e2355c 编写于 作者: D David Lin 提交者: GitHub

Update tos_sem.c

上级 b46d687e
......@@ -22,15 +22,14 @@
__API__ k_err_t tos_sem_create_max(k_sem_t *sem, k_sem_cnt_t init_count, k_sem_cnt_t max_count)
{
TOS_PTR_SANITY_CHECK(sem);
sem->count = init_count;
sem->count_max = max_count;
if(sem->count > sem->count_max)
{
sem->count_max = sem->count;
if (unlikely(init_count > max_count)) {
init_count = max_count;
}
sem->count = init_count;
sem->count_max = max_count;
pend_object_init(&sem->pend_obj);
TOS_OBJ_INIT(sem, KNL_OBJ_TYPE_SEMAPHORE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册