if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); IOLocked--; if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave");
try { if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } finally { IOLocked--; }
		public void flush() throws IOException		{			if (debug)				z.reportln( "RXTXPort:SerialOutputStream:flush() enter");			if( speed == 0 ) return;			if ( fd == 0 ) throw new IOException();			if ( monThreadisInterrupted == true )			{			if (debug)				z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted");				return;			}			IOLocked++;			waitForTheNativeCodeSilly();			/* 			   this is probably good on all OS's but for now			   just sendEvent from java on Sol			*/			if ( nativeDrain( monThreadisInterrupted ) )				sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true );			IOLocked--;			if (debug)				z.reportln( "RXTXPort:SerialOutputStream:flush() leave");		}