[hamradio-commits] [gnss-sdr] 62/303: Kill queue

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 f3b8b54801fa9f0876d8cb8c899b498ab65d8035
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Sat Oct 1 17:53:18 2016 +0200

    Kill queue
---
 src/tests/system-tests/ttff_gps_l1.cc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff_gps_l1.cc
index 5979f9d..5564b8e 100644
--- a/src/tests/system-tests/ttff_gps_l1.cc
+++ b/src/tests/system-tests/ttff_gps_l1.cc
@@ -128,7 +128,6 @@ TEST(TTFF_GPS_L1_CA_Test, ColdStart)
     std::shared_ptr<InMemoryConfiguration> config;
     std::shared_ptr<FileConfiguration> config2;
     unsigned int num_measurements = 0;
-    unsigned int num_valid_measurements = 0;
     config = std::make_shared<InMemoryConfiguration>();
     std::string path = std::string(TEST_PATH);
     std::string filename = path + "../../conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf";
@@ -300,14 +299,22 @@ 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);
@@ -324,13 +331,16 @@ 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