This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 94ee7f6ea nimble: Use BLE_NPL_TIME_FOREVER for ble_npl_mutex_pend 
timeout
94ee7f6ea is described below

commit 94ee7f6ea3aa58d78071d08fd9f37017eb52fba6
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Aug 6 12:45:51 2025 +0200

    nimble: Use BLE_NPL_TIME_FOREVER for ble_npl_mutex_pend timeout
    
    If no timeout is required we should use BLE_NPL_TIME_FOREVER when
    locking.
---
 nimble/host/src/ble_gap.c      | 2 +-
 nimble/host/src/ble_hs.c       | 2 +-
 nimble/transport/src/monitor.c | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 80ab840c8..4928454d4 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -6965,7 +6965,7 @@ ble_gap_preempt_done(void)
     disc_preempted = 0;
 
     /* Protects slaves from accessing by multiple threads */
-    ble_npl_mutex_pend(&preempt_done_mutex, 0xFFFFFFFF);
+    ble_npl_mutex_pend(&preempt_done_mutex, BLE_NPL_TIME_FOREVER);
     memset(slaves, 0, sizeof(slaves));
 
     ble_hs_lock();
diff --git a/nimble/host/src/ble_hs.c b/nimble/host/src/ble_hs.c
index 70a4aa6c9..42c83c9b7 100644
--- a/nimble/host/src/ble_hs.c
+++ b/nimble/host/src/ble_hs.c
@@ -164,7 +164,7 @@ ble_hs_lock_nested(void)
     }
 #endif
 
-    rc = ble_npl_mutex_pend(&ble_hs_mutex, 0xffffffff);
+    rc = ble_npl_mutex_pend(&ble_hs_mutex, BLE_NPL_TIME_FOREVER);
     BLE_HS_DBG_ASSERT_EVAL(rc == 0 || rc == OS_NOT_STARTED);
 }
 
diff --git a/nimble/transport/src/monitor.c b/nimble/transport/src/monitor.c
index c67b18df2..66382c073 100644
--- a/nimble/transport/src/monitor.c
+++ b/nimble/transport/src/monitor.c
@@ -281,7 +281,7 @@ static FILE *btmon = (FILE *) &(struct File) {
 static void
 drops_tmp_cb(struct ble_npl_event *ev)
 {
-    ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
+    ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
 
     /*
      * There's no "nop" in btsnoop protocol so we just send empty system note
@@ -352,7 +352,7 @@ ble_monitor_init(void)
 int
 ble_monitor_send(uint16_t opcode, const void *data, size_t len)
 {
-    ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
+    ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
 
     monitor_write_header(opcode, len);
     monitor_write(data, len);
@@ -374,7 +374,7 @@ ble_monitor_send_om(uint16_t opcode, const struct os_mbuf 
*om)
         om_tmp = SLIST_NEXT(om_tmp, om_next);
     }
 
-    ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
+    ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
 
     monitor_write_header(opcode, length);
 
@@ -436,7 +436,7 @@ ble_monitor_log(int level, const char *fmt, ...)
 
     ulog.ident_len = sizeof(id);
 
-    ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
+    ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
 
     monitor_write_header(BLE_MONITOR_OPCODE_USER_LOGGING,
                          sizeof(ulog) + sizeof(id) + len + 1);

Reply via email to