Fixed bugs
							parent
							
								
									c1bfb07196
								
							
						
					
					
						commit
						6809c61148
					
				| 
						 | 
				
			
			@ -37,7 +37,7 @@ void ControlledQueue::put(uint32_t word) {
 | 
			
		|||
uint32_t ControlledQueue::get() {
 | 
			
		||||
    std::unique_lock<std::mutex> lk(m_mtx);
 | 
			
		||||
 | 
			
		||||
    if ( !m_cv.wait_for(lk, std::chrono::microseconds(m_timeoutMicroseconds), !(m_queue.empty())) ) {
 | 
			
		||||
    if ( !m_cv.wait_for(lk, std::chrono::microseconds(m_timeoutMicroseconds), [&]() { return !(m_queue.empty()); } ) ) {
 | 
			
		||||
        throw TimeoutException();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										
											BIN
										
									
								
								evBuild.out
								
								
								
								
							
							
						
						
									
										
											BIN
										
									
								
								evBuild.out
								
								
								
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -1,4 +1,3 @@
 | 
			
		|||
#include "ControlledQueue.h"
 | 
			
		||||
#include <cerrno>
 | 
			
		||||
#include <cstddef>
 | 
			
		||||
#include <cinttypes>
 | 
			
		||||
| 
						 | 
				
			
			@ -33,6 +32,7 @@
 | 
			
		|||
#include "fragment_dataformat.h"
 | 
			
		||||
#include "full_event_format.h"
 | 
			
		||||
#include "TimeoutException.h"
 | 
			
		||||
#include "ControlledQueue.h"
 | 
			
		||||
 | 
			
		||||
#define MAX_EVENTS 1024
 | 
			
		||||
#define MAX_QUEUE_SIZE 1000
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -103,14 +103,14 @@ int main(int argc, char* argv[]) {
 | 
			
		|||
        uint8_t incorrectError = discrete_distr(generator);
 | 
			
		||||
        uint8_t corruptedError = discrete_distr(generator);
 | 
			
		||||
        uint8_t missingDataError = discrete_distr(generator);
 | 
			
		||||
        uint8_t timeoutError = discrete_distr(generator);
 | 
			
		||||
        //uint8_t timeoutError = discrete_distr(generator);
 | 
			
		||||
 | 
			
		||||
        uint32_t firstStatusElement = 0x0;
 | 
			
		||||
 | 
			
		||||
        if (incorrectError) firstStatusElement |= INCORRECT_ERROR;
 | 
			
		||||
        if (corruptedError) firstStatusElement |= CORRUPTED_ERROR;
 | 
			
		||||
        if (missingDataError) firstStatusElement |= MISSING_DATA_ERROR;
 | 
			
		||||
        if (timeoutError) firstStatusElement |= TIMEOUT_ERROR;
 | 
			
		||||
        //if (timeoutError) firstStatusElement |= TIMEOUT_ERROR;
 | 
			
		||||
 | 
			
		||||
        if (firstStatusElement != 0x0) {
 | 
			
		||||
            header.numberOfStatusElements = 1;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue