Commit a642858e authored by rna's avatar rna
Browse files

Use blocking Pipe_pull. Wake pipe on interrupt.

parent d6bbe761
Pipeline #2016 failed with stages
in 1 minute
...@@ -131,7 +131,7 @@ void *send_data_loop(void *ptr) { ...@@ -131,7 +131,7 @@ void *send_data_loop(void *ptr) {
while (1) { while (1) {
ListNode *job; ListNode *job;
do { do {
job = Pipe_poll(sock_ptr->sendDataQueue); job = Pipe_pull(sock_ptr->sendDataQueue);
if (PrrtSocket_closing(sock_ptr)) { if (PrrtSocket_closing(sock_ptr)) {
if (block != NULL) { if (block != NULL) {
PrrtBlock_destroy(block); PrrtBlock_destroy(block);
......
...@@ -380,6 +380,10 @@ int PrrtSocket_interrupt(PrrtSocket *s) { ...@@ -380,6 +380,10 @@ int PrrtSocket_interrupt(PrrtSocket *s) {
PrrtReceiver_interrupt(s->receiver); PrrtReceiver_interrupt(s->receiver);
} }
if(s->sendDataQueue != NULL) {
Pipe_wake(s->sendDataQueue);
}
void **res = NULL; void **res = NULL;
if (s->sendDataThread != 0) { if (s->sendDataThread != 0) {
check(pthread_join(s->sendDataThread, res) == 0, "Join failed."); check(pthread_join(s->sendDataThread, res) == 0, "Join 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