fix: exit condition handling
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
		
							parent
							
								
									227ab3f45d
								
							
						
					
					
						commit
						f78bb963fb
					
				@ -67,7 +67,7 @@ proc midiEventPrinterProc() {.thread.} =
 | 
			
		||||
 | 
			
		||||
    dataReadyLock.acquire()
 | 
			
		||||
 | 
			
		||||
    while not exitLoop:
 | 
			
		||||
    while true:
 | 
			
		||||
        while not exitLoop and ringbufferReadSpace(rb) >= 4:
 | 
			
		||||
            var read = cast[int](ringbufferRead(rb, cast[cstring](recvBuf.addr), 4))
 | 
			
		||||
 | 
			
		||||
@ -78,6 +78,9 @@ proc midiEventPrinterProc() {.thread.} =
 | 
			
		||||
                stdout.write("\n")
 | 
			
		||||
                stdout.flushFile()
 | 
			
		||||
 | 
			
		||||
        if exitLoop:
 | 
			
		||||
            break
 | 
			
		||||
 | 
			
		||||
        dataReady.wait(dataReadyLock)
 | 
			
		||||
 | 
			
		||||
    dataReadyLock.release()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user