Skip to content

Commit

Permalink
Remove unnecessary _oc_signal_event_loop calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius1922 committed Sep 4, 2023
1 parent 92f6a3b commit 277aab3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
9 changes: 3 additions & 6 deletions api/cloud/oc_cloud_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,20 @@ cloud_start_process(oc_cloud_context_t *ctx)
ctx->store.cps == OC_CPS_READYTOREGISTER) {
oc_reset_delayed_callback(ctx, cloud_manager_register_async,
g_retry_timeout[0]);
goto finish;
return;
}
if ((ctx->store.status & OC_CLOUD_REGISTERED) != 0) {
if (cloud_context_has_permanent_access_token(ctx)) {
oc_reset_delayed_callback(ctx, cloud_manager_login_async,
g_retry_timeout[0]);
goto finish;
return;
}
if (cloud_context_has_refresh_token(ctx)) {
oc_reset_delayed_callback(ctx, cloud_manager_refresh_token_async,
g_retry_timeout[0]);
goto finish;
return;
}
}

finish:
_oc_signal_event_loop();
}

static uint64_t
Expand Down
1 change: 0 additions & 1 deletion api/cloud/oc_cloud_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ cloud_store_dump_async(const oc_cloud_store_t *store)
// so this void* cast which drops const is safe
oc_remove_delayed_callback((void *)store, cloud_store_dump_handler);
oc_set_delayed_callback((void *)store, cloud_store_dump_handler, 0);
_oc_signal_event_loop();
}

static bool
Expand Down
2 changes: 0 additions & 2 deletions api/oc_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ oc_send_message(oc_message_t *message)
message) == OC_PROCESS_ERR_FULL) {
oc_message_unref(message);
}
_oc_signal_event_loop();
}

#ifdef OC_HAS_FEATURE_TCP_ASYNC_CONNECT
Expand All @@ -241,7 +240,6 @@ oc_tcp_connect_session(oc_tcp_on_connect_event_t *event)
event) == OC_PROCESS_ERR_FULL) {
oc_tcp_on_connect_event_free(event);
}
_oc_signal_event_loop();
}
#endif /* OC_HAS_FEATURE_TCP_ASYNC_CONNECT */

Expand Down
4 changes: 4 additions & 0 deletions api/oc_network_events_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ OC_PROCESS_NAME(oc_network_events);
* @brief network receive event
*
* @param message the network message
*
* @note called from network thread
*/
void oc_network_receive_event(oc_message_t *message);

Expand All @@ -47,6 +49,8 @@ void oc_network_receive_event(oc_message_t *message);
* @brief network TCP connect event
*
* @param event the TCP on connect event
*
* @note called from network thread
*/
void oc_network_tcp_connect_event(oc_tcp_on_connect_event_t *event);
#endif /* OC_HAS_FEATURE_TCP_ASYNC_CONNECT */
Expand Down
1 change: 0 additions & 1 deletion messaging/coap/observe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,6 @@ static void
dispatch_process_batch_observers(void)
{
oc_reset_delayed_callback(NULL, &process_batch_observers_async, 0);
_oc_signal_event_loop();
}

static void
Expand Down

0 comments on commit 277aab3

Please sign in to comment.