Improved multithreading to use second condition to wait on to take turns
b/w capture and processing threads.