Hello Yugo-san,
> I attached v2 patch including the documentation and some comments
> in the code.
I've looked at this patch.
I'm unclear whether it does what it says: "exit immediately on abort", I
would expect a cold call to "exit" (with a clear message obviously) when
the abort occurs.
Currently it skips to "done" which starts by closing this particular
thread client connections, then it will call "exit" later, so it is not
"immediate".
I do not think that this cleanup is necessary, because anyway all other
threads will be brutally killed by the exit called by the aborted thread,
so why bothering to disconnect only some connections?
/* If any client is aborted, exit immediately. */
if (state[i].state != CSTATE_FINISHED)
For this comment, I would prefer "if ( ... == CSTATE_ABORTED)" rather that
implying that not finished means aborted, and if you follow my previous
remark then this code can be removed.
Typo: "going to exist" -> "going to exit". Note that it is not "the whole
thread" but "the program" which is exiting.
There is no test.
--
Fabien.