ltp icon indicating copy to clipboard operation
ltp copied to clipboard

open_posix: add usleep aviod semcount overturn in pthread_kill testcase

Open extinguish opened this issue 2 years ago • 1 comments

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]

extinguish avatar Aug 31 '23 07:08 extinguish

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.

metan-ucw avatar Jan 09 '24 13:01 metan-ucw