Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open_posix: add usleep aviod semcount overturn in pthread_kill testcase #1072

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

extinguish
Copy link

@extinguish extinguish commented Aug 31, 2023

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 anjiahao@xiaomi.com

A short-term infinite loop will cause semcount
to exceed the limit in sem_post

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
@extinguish extinguish changed the title pthread_kill:add usleep aviod semcount overturn open_posix: add usleep aviod semcount overturn in pthread_kill testcase Sep 1, 2023
@richiejp richiejp added the posix POSIX conformance test suite label Nov 24, 2023
@metan-ucw
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
posix POSIX conformance test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants