[hamradio-commits] [gnss-sdr] 64/303: Terminate run when testing TTFF
Carles Fernandez
carles_fernandez-guest at moszumanska.debian.org
Mon Feb 13 22:35:48 UTC 2017
This is an automated email from the git hooks/post-receive script.
carles_fernandez-guest pushed a commit to branch master
in repository gnss-sdr.
commit b80eba91c89a3d15c2ff3fd7619c9fd25b2abf73
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date: Sat Oct 1 18:43:58 2016 +0200
Terminate run when testing TTFF
---
src/core/receiver/control_thread.cc | 3 ++-
src/tests/system-tests/ttff_gps_l1.cc | 15 ++-------------
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc
index c691688..7a5e9a3 100644
--- a/src/core/receiver/control_thread.cc
+++ b/src/core/receiver/control_thread.cc
@@ -529,9 +529,10 @@ void ControlThread::sysv_queue_listener()
int msqid;
key_t key = 1102;
// wait for the queue to be created
- while((msqid = msgget(key, 0644)) == -1){}
+
while(read_queue)
{
+ while((msqid = msgget(key, 0644)) == -1){}
if (msgrcv(msqid, &msg, msgrcv_size, 1, 0) != -1)
{
diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff_gps_l1.cc
index f0923a0..108973e 100644
--- a/src/tests/system-tests/ttff_gps_l1.cc
+++ b/src/tests/system-tests/ttff_gps_l1.cc
@@ -72,7 +72,7 @@ void receive_msg()
{
ttff_msgbuf msg;
ttff_msgbuf msg_stop;
- msg_stop.mtype = 2;
+ msg_stop.mtype = 1;
msg_stop.ttff = 200;
double ttff_msg = 0.0;
int msgrcv_size = sizeof(msg.ttff);
@@ -303,22 +303,15 @@ int main(int argc, char **argv)
// Create Sys V message queue to read TFFF measurements
key_t sysv_msg_key;
- key_t sysv_stop_key;
int sysv_msqid;
- int sysv_msqid_stop;
sysv_msg_key = 1101;
- sysv_stop_key = 1102;
int msgflg = IPC_CREAT | 0666;
if ((sysv_msqid = msgget(sysv_msg_key, msgflg )) == -1)
{
std::cout<<"GNSS-SDR can not create message queues!" << std::endl;
throw new std::exception();
}
- if ((sysv_msqid_stop = msgget(sysv_stop_key, msgflg )) == -1)
- {
- std::cout<<"GNSS-SDR can not create message queues!" << std::endl;
- throw new std::exception();
- }
+
// Start queue thread
std::thread receive_msg_thread(receive_msg);
@@ -335,16 +328,12 @@ int main(int argc, char **argv)
// Terminate the queue thread
ttff_msgbuf msg;
- //ttff_msgbuf msg_stop;
msg.mtype = 1;
msg.ttff = -1;
- //msg_stop.mtype = 1;
- //msg_stop.ttff = 200;
int msgsend_size;
msgsend_size = sizeof(msg.ttff);
msgsnd(sysv_msqid, &msg, msgsend_size, IPC_NOWAIT);
receive_msg_thread.join();
- //msgsnd(sysv_msqid_stop, &msg_stop, msgsend_size, IPC_NOWAIT);
google::ShutDownCommandLineFlags();
return res;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git
More information about the pkg-hamradio-commits
mailing list