Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions components/lwp/lwp_pmutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static int _pthread_mutex_init(void *umutex)
if (lock_ret != RT_EOK)
{
rt_set_errno(EAGAIN);
return -EINTR;
return -EAGAIN;
}

lwp = lwp_self();
Expand Down Expand Up @@ -262,7 +262,7 @@ static int _pthread_mutex_lock_timeout(void *umutex, struct timespec *timeout)
lock_ret = rt_mutex_take_interruptible(&_pmutex_lock, RT_WAITING_FOREVER);
if (lock_ret != RT_EOK)
{
rt_set_errno(EAGAIN);
rt_set_errno(EINTR);
return -EINTR;
}

Expand Down Expand Up @@ -323,6 +323,11 @@ static int _pthread_mutex_lock_timeout(void *umutex, struct timespec *timeout)
return -ETIMEDOUT;
}
}
else if (lock_ret == -RT_EINTR)
{
rt_set_errno(EINTR);
return -EINTR;
}
else
{
rt_set_errno(EAGAIN);
Expand All @@ -343,7 +348,7 @@ static int _pthread_mutex_unlock(void *umutex)
if (lock_ret != RT_EOK)
{
rt_set_errno(EAGAIN);
return -EINTR;
return -EAGAIN;
}

lwp = lwp_self();
Expand Down Expand Up @@ -385,7 +390,7 @@ static int _pthread_mutex_unlock(void *umutex)
if (lock_ret != RT_EOK)
{
rt_set_errno(EPERM);
return -EAGAIN;
return -EPERM;
}
return 0;
}
Expand All @@ -400,7 +405,7 @@ static int _pthread_mutex_destroy(void *umutex)
if (lock_ret != RT_EOK)
{
rt_set_errno(EAGAIN);
return -EINTR;
return -EAGAIN;
}

lwp = lwp_self();
Expand Down