@@ -45,6 +45,7 @@ class tracked_cell_t {
45
45
crs_sp_av=NAN;
46
46
crs_np_av=itpp::vec (4 );
47
47
crs_np_av=NAN;
48
+ launched=false ;
48
49
}
49
50
inline uint8 const n_symb_dl () const {
50
51
return (cp_type==cp_type_t ::NORMAL)?7 :((cp_type==cp_type_t ::EXTENDED)?6 :-1 );
@@ -67,6 +68,8 @@ class tracked_cell_t {
67
68
68
69
// Indicates that the tracker process is ready to receive data.
69
70
bool tracker_thread_ready;
71
+ // Indicates that the thread has been launched
72
+ bool launched;
70
73
71
74
// Mutex and measurement data produced by the tracker thread and read by
72
75
// the display thread.
@@ -100,7 +103,6 @@ class tracked_cell_t {
100
103
// threads.
101
104
boost::mutex frame_timing_mutex;
102
105
double frame_timing_private;
103
-
104
106
};
105
107
// Structure that is used to record all the tracked cells.
106
108
typedef struct {
@@ -111,20 +113,12 @@ typedef struct {
111
113
std::list <tracked_cell_t *> tracked_cells;
112
114
} tracked_cell_list_t ;
113
115
// Global data shared by all threads
114
- /*
115
- typedef struct {
116
- // The frequency offset of the dongle. This value will be updated
117
- // continuously.
118
- boost::mutex frequency_offset_mutex;
119
- double frequency_offset;
120
- // This value will never change.
121
- double fc;
122
- } global_thread_data_t;
123
- */
124
116
class global_thread_data_t {
125
117
public:
126
118
// Constructor
127
119
global_thread_data_t (const double & fc) : fc(fc) {
120
+ searcher_cycle_time_private=0 ;
121
+ cell_seconds_dropped_private=0 ;
128
122
}
129
123
// This value will never change.
130
124
const double fc;
@@ -140,11 +134,40 @@ class global_thread_data_t {
140
134
boost::mutex::scoped_lock lock (frequency_offset_mutex);
141
135
frequency_offset_private=f;
142
136
}
137
+ // Read/write searcher cycle time (via mutex).
138
+ // Mutex makes sure that no read or write is interrupted when
139
+ // only part of the data has been read.
140
+ inline double searcher_cycle_time () {
141
+ boost::mutex::scoped_lock lock (searcher_cycle_time_mutex);
142
+ double r=searcher_cycle_time_private;
143
+ return r;
144
+ }
145
+ inline void searcher_cycle_time (const double & t) {
146
+ boost::mutex::scoped_lock lock (searcher_cycle_time_mutex);
147
+ searcher_cycle_time_private=t;
148
+ }
149
+ inline uint32 cell_seconds_dropped () {
150
+ boost::mutex::scoped_lock lock (cell_seconds_dropped_mutex);
151
+ double r=cell_seconds_dropped_private;
152
+ return r;
153
+ }
154
+ inline void cell_seconds_dropped_inc () {
155
+ boost::mutex::scoped_lock lock (cell_seconds_dropped_mutex);
156
+ cell_seconds_dropped_private+=1 ;
157
+ }
158
+ uint32 searcher_thread_id;
159
+ uint32 producer_thread_id;
160
+ uint32 main_thread_id;
161
+ uint32 display_thread_id;
143
162
private:
144
163
// The frequency offset of the dongle. This value will be updated
145
164
// continuously.
146
165
boost::mutex frequency_offset_mutex;
147
166
double frequency_offset_private;
167
+ boost::mutex searcher_cycle_time_mutex;
168
+ double searcher_cycle_time_private;
169
+ boost::mutex cell_seconds_dropped_mutex;
170
+ uint32 cell_seconds_dropped_private;
148
171
};
149
172
// IPC between main thread and searcher thread covering data capture issues.
150
173
typedef struct {
0 commit comments