提交 a731e410 编写于 作者: R Rich Felker

fix invalid pointer in synccall (multithread setuid, etc.)

the head pointer was not being reset between calls to synccall, so any
use of this interface more than once would build the linked list
incorrectly, keeping the (now invalid) list nodes from the previous
call.
上级 fe80a8eb
......@@ -58,6 +58,7 @@ void __synccall(void (*func)(void *), void *ctx)
sem_init(&chaindone, 0, 0);
sem_init(&chainlock, 0, 1);
chainlen = 0;
head = 0;
callback = func;
context = ctx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册