ltp
ltp copied to clipboard
open_posix: add usleep aviod semcount overturn in pthread_kill testcase
A short-term infinite loop will cause semcount to exceed the limit in sem_post, so we add sleep to fix this case
Signed-off-by: anjiahao [email protected]
What exactly is the problem here?
The change does not look good to me, as far as I understand the test we are trying to check if pthread_kill() will fail with EINTR or not, and we do that by sending signals while one of the threads is calling pthread_kill() in a loop. The idea is that this thread should spend as much time in the pthread_kill() call as possible in order to have some chances of signal arriving while that thread is inside of the pthread_kill() syscall. Putting usleep() into that exact loop does not seem to be a good idea.