examples/oo-mutex.js
function(activateNextConnection) {
		if ( (count % 20) == 0 || timeoutOccurred) {
			timeoutOccurred = false;
			exec('killall -9 soffice.bin libreoffice soffice', function(error, stdout, stderr) {
		
				waitForOOState('closed', function() {
					exec('libreoffice -headless -nofirststartwizard -accept="socket,host=0.0.0.0,port=8100;urp;StarOffice.Service"'); 
					waitForOOState('open', function() {
						activateNextConnection();
					});
				});
		
			});
		} else {
			activateNextConnection();
		}
		count += 1;
	}
function(activateNextConnection) {
		if ( (count % 20) == 0 || timeoutOccurred) {
			timeoutOccurred = false;
			exec('killall -9 soffice.bin libreoffice soffice', function(error, stdout, stderr) {
		
				waitForOOState('closed', function() {
					exec('libreoffice -headless -nofirststartwizard -accept="socket,host=0.0.0.0,port=8100;urp;StarOffice.Service"'); 
					waitForOOState('open', function() {
						activateNextConnection();
					});
				});
		
			});
		} else {
			activateNextConnection();
		}
		count += 1;
	}
function ( activateNextConnection ) { if ( ( count % 20 ) == 0 || timeoutOccurred ) { timeoutOccurred = false ; exec ( 'killall -9 soffice.bin libreoffice soffice' , function ( error , stdout , stderr ) { waitForOOState ( 'closed' , function ( ) { exec ( 'libreoffice -headless -nofirststartwizard -accept="socket,host=0.0.0.0,port=8100;urp;StarOffice.Service"' ) ; waitForOOState ( 'open' , function ( ) { activateNextConnection ( ) ; } ) ; } ) ; } ) ; } else { activateNextConnection ( ) ; } count += 1 ; }
Only alow OOP to run for 20 seconds.
Only alow OOP to run for 20 seconds .