Skip to content

Commit

Permalink
lib: at_host: Remove redundant mutex
Browse files Browse the repository at this point in the history
Removing redundant mutes, as there's only one context accessing
the resource at the time.

Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
  • Loading branch information
jtguggedal committed Apr 11, 2019
1 parent 029fb9c commit 595b45b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/at_host/at_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ static size_t at_buf_len;
static struct k_work at_cmd_send_work;
static struct k_thread socket_thread;
static K_THREAD_STACK_DEFINE(socket_thread_stack, THREAD_STACK_SIZE);
static struct k_mutex socket_mutex;


static const char termination[3] = { '\0', '\r', '\n' };
Expand All @@ -72,9 +71,7 @@ static void at_cmd_send(struct k_work *work)

ARG_UNUSED(work);

k_mutex_lock(&socket_mutex, K_FOREVER);
bytes_sent = send(at_socket_fd, at_buf, at_buf_len, 0);
k_mutex_unlock(&socket_mutex);

if (bytes_sent <= 0) {
LOG_ERR("Could not send AT command to modem: %d", bytes_sent);
Expand Down Expand Up @@ -267,7 +264,6 @@ static int at_host_init(struct device *arg)
}
}

k_mutex_init(&socket_mutex);
k_work_init(&at_cmd_send_work, at_cmd_send);
k_thread_create(&socket_thread, socket_thread_stack,
K_THREAD_STACK_SIZEOF(socket_thread_stack),
Expand Down

0 comments on commit 595b45b

Please sign in to comment.