Commit d332a6c8 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Move a lock.

parent fbda18a3
Pipeline #641 passed with stage
in 30 seconds
......@@ -116,10 +116,9 @@ int PrrtSocket_connect(PrrtSocket *sock_ptr, const char *host, const uint16_t po
int PrrtSocket_send(PrrtSocket *sock_ptr, const uint8_t *data, const size_t data_len) {
check(sock_ptr->isSender, "Cannot send on receiver socket.")
check(pthread_mutex_lock(&sock_ptr->outQueueFilledMutex) == 0, "Lock failed.");
PrrtPacket *packet = PrrtPacket_create_data_packet(5, data, (prrtPacketLength_t) data_len, 0, PrrtApplicationConstraints_get_target_delay(sock_ptr->applicationConstraints));
check(pthread_mutex_lock(&sock_ptr->outQueueFilledMutex) == 0, "Lock failed.");
List_push(sock_ptr->outQueue, packet);
check(pthread_cond_signal(&sock_ptr->outQueueFilledCv) == 0, "Signal failed.");
check(pthread_mutex_unlock(&sock_ptr->outQueueFilledMutex) == 0, "Unlock failed");
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment