Skip to content

Commit

Permalink
Update websocket_server.c
Browse files Browse the repository at this point in the history
Fix for using functions in another FreeRTOS Task
  • Loading branch information
JannesBrands authored Oct 22, 2020
1 parent 5e417ab commit db59932
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions websocket_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,23 +294,17 @@ int ws_server_remove_all() {
// The following functions are already written below, but without the mutex.

int ws_server_send_text_client(int num,char* msg,uint64_t len) {
xSemaphoreTake(xwebsocket_mutex,portMAX_DELAY);
int ret = ws_server_send_text_client_from_callback(num, msg, len);
xSemaphoreGive(xwebsocket_mutex);
return ret;
}

int ws_server_send_text_clients(char* url,char* msg,uint64_t len) {
xSemaphoreTake(xwebsocket_mutex,portMAX_DELAY);
int ret = ws_server_send_text_clients_from_callback(url, msg, len);
xSemaphoreGive(xwebsocket_mutex);
return ret;
}

int ws_server_send_text_all(char* msg,uint64_t len) {
xSemaphoreTake(xwebsocket_mutex,portMAX_DELAY);
int ret = ws_server_send_text_all_from_callback(msg, len);
xSemaphoreGive(xwebsocket_mutex);
return ret;
}

Expand Down

0 comments on commit db59932

Please sign in to comment.