Skip to content

Commit acec623

Browse files
committed
Merge remote-tracking branch 'origin/main' into new_call_api
# Conflicts: # src/bridge.h
2 parents 31ddb45 + 3226cc2 commit acec623

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bridge.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,14 @@ class BridgeClass {
204204

205205
template<typename... Args>
206206
void notify(const MsgPack::str_t method, Args&&... args) {
207-
client->notify(method, std::forward<Args>(args)...);
207+
while (true) {
208+
if (k_mutex_lock(&write_mutex, K_MSEC(10)) == 0) {
209+
client->notify(method, std::forward<Args>(args)...);
210+
k_mutex_unlock(&write_mutex);
211+
break;
212+
}
213+
k_yield();
214+
}
208215
}
209216

210217
String get_error_message() const {

0 commit comments

Comments
 (0)