diff --git a/main.cpp b/main.cpp index 6ea1724..e7fe4d4 100644 --- a/main.cpp +++ b/main.cpp @@ -71,11 +71,12 @@ static void poh_thread() { std::vector block_mag(block_len); + poh_accept_input = true; // accept first block while(!shutdown_threads) { - poh_accept_input = true; poh_input_ready.acquire(); fft_mag(poh_input_block, block_mag.data(), block_len); + poh_accept_input = true; // poh_input_block not used again until next iteration // stabilize laser float freq_peak_local; @@ -107,10 +108,11 @@ static void ls_thread() { std::vector block_mag(block_len); + ls_accept_input = true; while(!shutdown_threads) { - ls_accept_input = true; ls_input_ready.acquire(); fft_mag(ls_input_block, block_mag.data(), block_len); + ls_accept_input = true; { std::lock_guard guard(wf_ls_mutex); std::memmove(&wf_ls[wf_width], &wf_ls[0], sizeof(int)*wf_width*(wf_height - 1));