[IE][VPU]: changed calling of sem_timedwait() to account for EINTR error code (#6213)
changed calling of sem_timedwait() to account for EINTR error code, so it would be restarted.
This commit is contained in:
parent
56adef710a
commit
5f90f33731
@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <errno.h>
|
||||
#include "XLinkSemaphore.h"
|
||||
#include "XLinkErrorUtils.h"
|
||||
#include "XLinkLog.h"
|
||||
@ -104,7 +105,9 @@ int XLink_sem_timedwait(XLink_sem_t* sem, const struct timespec* abstime)
|
||||
XLINK_RET_ERR_IF(abstime == NULL, -1);
|
||||
|
||||
XLINK_RET_IF_FAIL(XLink_sem_inc(sem));
|
||||
int ret = sem_timedwait(&sem->psem, abstime);
|
||||
int ret;
|
||||
while(((ret = sem_timedwait(&sem->psem, abstime)) == -1) && errno == EINTR)
|
||||
continue;
|
||||
XLINK_RET_IF_FAIL(XLink_sem_dec(sem));
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user