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

fix: pthread_rwlock_timedwrlock. #5931

Merged
merged 1 commit into from
May 19, 2022

Conversation

jihandong
Copy link
Contributor

Upon return from the signal handler the thread shall resume waiting
as if it is not interrupted.

Add error return ETIMEOUT to nxsem_wait().

Signed-off-by: jihandong jihandong@xiaomi.com

sched/semaphore/sem_wait.c Outdated Show resolved Hide resolved
libs/libc/pthread/pthread_rwlock_rdlock.c Outdated Show resolved Hide resolved
libs/libc/pthread/pthread_rwlock_wrlock.c Outdated Show resolved Hide resolved
sched/semaphore/sem_wait.c Outdated Show resolved Hide resolved
sched/signal/sig_dispatch.c Outdated Show resolved Hide resolved
sched/signal/sig_dispatch.c Outdated Show resolved Hide resolved
include/signal.h Outdated Show resolved Hide resolved
sched/semaphore/sem_wait.c Outdated Show resolved Hide resolved
libs/libc/pthread/pthread_rwlock_wrlock.c Outdated Show resolved Hide resolved
sched/pthread/pthread_condclockwait.c Outdated Show resolved Hide resolved
sched/pthread/pthread_condclockwait.c Outdated Show resolved Hide resolved
sched/pthread/pthread_condclockwait.c Outdated Show resolved Hide resolved
sched/pthread/pthread_condclockwait.c Outdated Show resolved Hide resolved
libs/libc/pthread/pthread_rwlock_rdlock.c Outdated Show resolved Hide resolved
@jihandong jihandong force-pushed the topic-20220401-1 branch 2 times, most recently from 2ad8cae to 8b7e104 Compare April 11, 2022 10:42
@pkarashchenko pkarashchenko self-requested a review April 11, 2022 14:00
pthread_condclockwait() can not distinguish between interrupt and timeout,
which cause these API not follow POSIX:
	pthread_rwlock_timedrdlock()
	pthread_rwlock_timedwrlock()
	pthread_condtimedwait()
POSIX:
	Upon return from the signal handler the thread resumes waiting for
	the condition variable as if it wasnot interrupted
	These functions shall not return an error code of [EINTR].

Replacing nxsem_wait() with nxsem_clockwait_uninterruptible() can solve it.

Signed-off-by: jihandong <jihandong@xiaomi.com>
@xiaoxiang781216
Copy link
Contributor

@pkarashchenko could you review again? The change look good for me now.

@pkarashchenko
Copy link
Contributor

Will review later today

Copy link
Contributor

@pkarashchenko pkarashchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@xiaoxiang781216 xiaoxiang781216 merged commit 89338a6 into apache:master May 19, 2022
@jerpelea jerpelea added this to To-Add in Release Notes - 11.0.0 Aug 30, 2022
@jerpelea jerpelea moved this from To-Add to Added in Release Notes - 11.0.0 Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants