rojer commented on code in PR #1855:
URL: https://github.com/apache/mynewt-nimble/pull/1855#discussion_r1746732834


##########
porting/npl/linux/src/os_sem.c:
##########
@@ -71,9 +71,12 @@ ble_npl_sem_pend(struct ble_npl_sem *sem, uint32_t timeout)
         wait.tv_sec  += timeout / 1000;
         wait.tv_nsec += (timeout % 1000) * 1000000;
 
-        err = sem_timedwait(&sem->lock, &wait);
-        if (err && errno == ETIMEDOUT) {
-            return BLE_NPL_TIMEOUT;
+        while ((err = sem_timedwait(&sem->lock, &wait)) != 0) {
+            switch (errno) {
+                case EINTR: continue;

Review Comment:
   fixed style.
   in the default case we fall through to return `BLE_NPL_ERROR` and stack 
restart is attempted.
   it happens to fail and assert but that's another story[1]. In theory a stack 
restart is the right thing to do in this case and might fix things.
   
   [1] Assert happens 
[here](https://github.com/apache/mynewt-nimble/blob/f8d60614b7df21db77f0ff75e30ee104c71fa649/nimble/host/src/ble_hs_hci.c#L316)
 because ble_hs_sched_reset 
[here](https://github.com/apache/mynewt-nimble/blob/f8d60614b7df21db77f0ff75e30ee104c71fa649/nimble/host/src/ble_hs_hci.c#L326)
 bites on its own tail - tries to tx a reset command.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to