Open ryancaicse opened 2 years ago
It may be, at this point I don't understand the code here. Did this produce a hang or crash at your side?
Hi, I guess, the lock is supposed to protect the THREAD(i)->exit = true;
from races. May be there is a missing CHEROKEE_MUTEX_LOCK
.
I just looked through the code (thread.c) to see what is is used for there. But I wonder if this is actually the way to unlock what has been locked there.
@skinkie It seems, in this loop, an identical lock is released multiple times rather than releasing different indexed locks. Thus, it is very likely a bug.
I also tried to investigate the reason. However, I could not find the possible held lock at that program point. I think it is more likely that the lock is supposed to protect the THREAD(i)->exit = true;
from races and there is a missing CHEROKEE_MUTEX_LOCK
.
Hi, there is only an unlocking in the loop, should it be a bug? https://github.com/cherokee/webserver/blob/5b1dbdb4dd68872014874ac05f8af0f833343d0f/cherokee/server.c#L266-L269