pthread rollback

pull/5/head
Guenael 2016-07-03 10:59:52 -04:00
rodzic bb5c1292f9
commit ef10c52d4f
1 zmienionych plików z 2 dodań i 8 usunięć

Wyświetl plik

@ -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, &param);
//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) {