Skip to content

Commit 94ee7f6

Browse files
committed
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.
1 parent ecc1a6d commit 94ee7f6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

nimble/host/src/ble_gap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6965,7 +6965,7 @@ ble_gap_preempt_done(void)
69656965
disc_preempted = 0;
69666966

69676967
/* Protects slaves from accessing by multiple threads */
6968-
ble_npl_mutex_pend(&preempt_done_mutex, 0xFFFFFFFF);
6968+
ble_npl_mutex_pend(&preempt_done_mutex, BLE_NPL_TIME_FOREVER);
69696969
memset(slaves, 0, sizeof(slaves));
69706970

69716971
ble_hs_lock();

nimble/host/src/ble_hs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ble_hs_lock_nested(void)
164164
}
165165
#endif
166166

167-
rc = ble_npl_mutex_pend(&ble_hs_mutex, 0xffffffff);
167+
rc = ble_npl_mutex_pend(&ble_hs_mutex, BLE_NPL_TIME_FOREVER);
168168
BLE_HS_DBG_ASSERT_EVAL(rc == 0 || rc == OS_NOT_STARTED);
169169
}
170170

nimble/transport/src/monitor.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static FILE *btmon = (FILE *) &(struct File) {
281281
static void
282282
drops_tmp_cb(struct ble_npl_event *ev)
283283
{
284-
ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
284+
ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
285285

286286
/*
287287
* There's no "nop" in btsnoop protocol so we just send empty system note
@@ -352,7 +352,7 @@ ble_monitor_init(void)
352352
int
353353
ble_monitor_send(uint16_t opcode, const void *data, size_t len)
354354
{
355-
ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
355+
ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
356356

357357
monitor_write_header(opcode, len);
358358
monitor_write(data, len);
@@ -374,7 +374,7 @@ ble_monitor_send_om(uint16_t opcode, const struct os_mbuf *om)
374374
om_tmp = SLIST_NEXT(om_tmp, om_next);
375375
}
376376

377-
ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
377+
ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
378378

379379
monitor_write_header(opcode, length);
380380

@@ -436,7 +436,7 @@ ble_monitor_log(int level, const char *fmt, ...)
436436

437437
ulog.ident_len = sizeof(id);
438438

439-
ble_npl_mutex_pend(&lock, OS_TIMEOUT_NEVER);
439+
ble_npl_mutex_pend(&lock, BLE_NPL_TIME_FOREVER);
440440

441441
monitor_write_header(BLE_MONITOR_OPCODE_USER_LOGGING,
442442
sizeof(ulog) + sizeof(id) + len + 1);

0 commit comments

Comments
 (0)