Commit 6e9ed1dc authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Rename sendThread.

parent 8ed7df12
...@@ -89,7 +89,7 @@ cdef extern from "prrt/socket.h": ...@@ -89,7 +89,7 @@ cdef extern from "prrt/socket.h":
int feedbackSocketFd int feedbackSocketFd
pthread_t receiveFeedbackThread pthread_t receiveFeedbackThread
pthread_t sendThread pthread_t sendDataThread
pthread_mutex_t outQueueFilledMutex pthread_mutex_t outQueueFilledMutex
pthread_cond_t outQueueFilledCv pthread_cond_t outQueueFilledCv
List* outQueue List* outQueue
......
...@@ -93,7 +93,7 @@ bool PrrtSocket_bind(PrrtSocket *sock_ptr, const char* ipAddress, const uint16_t ...@@ -93,7 +93,7 @@ bool PrrtSocket_bind(PrrtSocket *sock_ptr, const char* ipAddress, const uint16_t
if(sock_ptr->isSender) { if(sock_ptr->isSender) {
check(pthread_create(&sock_ptr->receiveFeedbackThread, NULL, receive_feedback_loop, (void *) sock_ptr) == check(pthread_create(&sock_ptr->receiveFeedbackThread, NULL, receive_feedback_loop, (void *) sock_ptr) ==
EXIT_SUCCESS, "Cannot create receive feedback thread."); EXIT_SUCCESS, "Cannot create receive feedback thread.");
check(pthread_create(&sock_ptr->sendThread, NULL, send_data_loop, (void *) sock_ptr) == EXIT_SUCCESS, check(pthread_create(&sock_ptr->sendDataThread, NULL, send_data_loop, (void *) sock_ptr) == EXIT_SUCCESS,
"Cannot create send thread."); "Cannot create send thread.");
} else { } else {
check(pthread_create(&sock_ptr->receiveDataThread, NULL, receive_data_loop, (void *) sock_ptr) == EXIT_SUCCESS, check(pthread_create(&sock_ptr->receiveDataThread, NULL, receive_data_loop, (void *) sock_ptr) == EXIT_SUCCESS,
...@@ -165,13 +165,13 @@ int PrrtSocket_interrupt(PrrtSocket *sock_ptr) { ...@@ -165,13 +165,13 @@ int PrrtSocket_interrupt(PrrtSocket *sock_ptr) {
check(pthread_mutex_unlock(&sock_ptr->closingMutex) == 0, "Unlock failed."); check(pthread_mutex_unlock(&sock_ptr->closingMutex) == 0, "Unlock failed.");
void **res = NULL; void **res = NULL;
if (sock_ptr->sendThread != 0) { if (sock_ptr->sendDataThread != 0) {
check(pthread_mutex_lock(&sock_ptr->outQueueFilledMutex) == 0, "Lock failed."); check(pthread_mutex_lock(&sock_ptr->outQueueFilledMutex) == 0, "Lock failed.");
check(pthread_cond_broadcast(&sock_ptr->outQueueFilledCv) == 0, "Broadcast failed."); check(pthread_cond_broadcast(&sock_ptr->outQueueFilledCv) == 0, "Broadcast failed.");
check(pthread_mutex_unlock(&sock_ptr->outQueueFilledMutex) == 0, "Unlock failed."); check(pthread_mutex_unlock(&sock_ptr->outQueueFilledMutex) == 0, "Unlock failed.");
check(pthread_join(sock_ptr->sendThread, res) == 0, "Join failed."); check(pthread_join(sock_ptr->sendDataThread, res) == 0, "Join failed.");
sock_ptr->sendThread = 0; sock_ptr->sendDataThread = 0;
} }
if (sock_ptr->receiveDataThread != 0) { if (sock_ptr->receiveDataThread != 0) {
......
...@@ -24,7 +24,7 @@ typedef struct prrtSocket { ...@@ -24,7 +24,7 @@ typedef struct prrtSocket {
PrrtClock* clock; PrrtClock* clock;
pthread_t sendThread; pthread_t sendDataThread;
pthread_mutex_t outQueueFilledMutex; pthread_mutex_t outQueueFilledMutex;
pthread_cond_t outQueueFilledCv; pthread_cond_t outQueueFilledCv;
List *outQueue; List *outQueue;
......
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