Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
PRRT
Commits
6e9ed1dc
Commit
6e9ed1dc
authored
Apr 08, 2016
by
Andreas Schmidt
Browse files
Rename sendThread.
parent
8ed7df12
Changes
3
Show whitespace changes
Inline
Side-by-side
src/cython/cprrt.pxd
View file @
6e9ed1dc
...
...
@@ -89,7 +89,7 @@ cdef extern from "prrt/socket.h":
int
feedbackSocketFd
pthread_t
receiveFeedbackThread
pthread_t
sendThread
pthread_t
send
Data
Thread
pthread_mutex_t
outQueueFilledMutex
pthread_cond_t
outQueueFilledCv
List
*
outQueue
...
...
src/prrt/socket.c
View file @
6e9ed1dc
...
...
@@ -93,7 +93,7 @@ bool PrrtSocket_bind(PrrtSocket *sock_ptr, const char* ipAddress, const uint16_t
if
(
sock_ptr
->
isSender
)
{
check
(
pthread_create
(
&
sock_ptr
->
receiveFeedbackThread
,
NULL
,
receive_feedback_loop
,
(
void
*
)
sock_ptr
)
==
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
->
send
Data
Thread
,
NULL
,
send_data_loop
,
(
void
*
)
sock_ptr
)
==
EXIT_SUCCESS
,
"Cannot create send thread."
);
}
else
{
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) {
check
(
pthread_mutex_unlock
(
&
sock_ptr
->
closingMutex
)
==
0
,
"Unlock failed."
);
void
**
res
=
NULL
;
if
(
sock_ptr
->
sendThread
!=
0
)
{
if
(
sock_ptr
->
send
Data
Thread
!=
0
)
{
check
(
pthread_mutex_lock
(
&
sock_ptr
->
outQueueFilledMutex
)
==
0
,
"Lock failed."
);
check
(
pthread_cond_broadcast
(
&
sock_ptr
->
outQueueFilledCv
)
==
0
,
"Broadcast failed."
);
check
(
pthread_mutex_unlock
(
&
sock_ptr
->
outQueueFilledMutex
)
==
0
,
"Unlock failed."
);
check
(
pthread_join
(
sock_ptr
->
sendThread
,
res
)
==
0
,
"Join failed."
);
sock_ptr
->
sendThread
=
0
;
check
(
pthread_join
(
sock_ptr
->
send
Data
Thread
,
res
)
==
0
,
"Join failed."
);
sock_ptr
->
send
Data
Thread
=
0
;
}
if
(
sock_ptr
->
receiveDataThread
!=
0
)
{
...
...
src/prrt/socket.h
View file @
6e9ed1dc
...
...
@@ -24,7 +24,7 @@ typedef struct prrtSocket {
PrrtClock
*
clock
;
pthread_t
sendThread
;
pthread_t
send
Data
Thread
;
pthread_mutex_t
outQueueFilledMutex
;
pthread_cond_t
outQueueFilledCv
;
List
*
outQueue
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment