set _rxThread to Background thread, making sure it will exit when the main(UI) thread exits
This commit is contained in:
		@@ -109,6 +109,8 @@ namespace PInvokeSerialPort
 | 
				
			|||||||
                                Name = "CommBaseRx",
 | 
					                                Name = "CommBaseRx",
 | 
				
			||||||
                                Priority = ThreadPriority.AboveNormal
 | 
					                                Priority = ThreadPriority.AboveNormal
 | 
				
			||||||
                            };
 | 
					                            };
 | 
				
			||||||
 | 
					            //If not set to true, my application process will not exit completely after UI closed
 | 
				
			||||||
 | 
					            _rxThread.IsBackground = true;
 | 
				
			||||||
            _rxThread.Start();
 | 
					            _rxThread.Start();
 | 
				
			||||||
            Thread.Sleep(1); //Give rx thread time to start. By documentation, 0 should work, but it does not!
 | 
					            Thread.Sleep(1); //Give rx thread time to start. By documentation, 0 should work, but it does not!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user