kopia lustrzana https://github.com/Guenael/rtlsdr-wsprd
pthread rollback
rodzic
bb5c1292f9
commit
ef10c52d4f
|
@ -84,10 +84,6 @@ struct decoder_state dec;
|
|||
/* Thread stuff for separate RX (blocking function) */
|
||||
struct dongle_state {
|
||||
pthread_t thread;
|
||||
|
||||
//pthread_rwlock_t rw;
|
||||
//pthread_cond_t ready_cond;
|
||||
//pthread_mutex_t ready_mutex;
|
||||
};
|
||||
struct dongle_state dongle;
|
||||
|
||||
|
@ -637,7 +633,7 @@ int main(int argc, char** argv) {
|
|||
uint32_t uwait = 120000000 - usec;
|
||||
printf("Wait for time sync (start in %d sec)\n\n", uwait/1000000);
|
||||
|
||||
/* Prepare a low priority param for the decoder thread
|
||||
/* Prepare a low priority param for the decoder thread */
|
||||
struct sched_param param;
|
||||
pthread_attr_init(&dec.tattr);
|
||||
pthread_attr_setschedpolicy(&dec.tattr, SCHED_RR);
|
||||
|
@ -646,7 +642,6 @@ int main(int argc, char** argv) {
|
|||
pthread_attr_setschedparam(&dec.tattr, ¶m);
|
||||
//int res=0;
|
||||
//printf("get: %d\n", res)
|
||||
*/
|
||||
|
||||
/* Create a thread and stuff for separate decoding
|
||||
Info : https://computing.llnl.gov/tutorials/pthreads/
|
||||
|
@ -655,8 +650,7 @@ int main(int argc, char** argv) {
|
|||
pthread_cond_init(&dec.ready_cond, NULL);
|
||||
pthread_mutex_init(&dec.ready_mutex, NULL);
|
||||
pthread_create(&dongle.thread, NULL, rtlsdr_rx, NULL);
|
||||
//pthread_create(&dec.thread, &dec.tattr, wsprDecoder, NULL);
|
||||
pthread_create(&dec.thread, NULL, wsprDecoder, NULL);
|
||||
pthread_create(&dec.thread, &dec.tattr, wsprDecoder, NULL);
|
||||
|
||||
/* Main loop : Wait, read, decode */
|
||||
while (!rx_state.exit_flag) {
|
||||
|
|
Ładowanie…
Reference in New Issue