@Override
	public void run() {
		try {
			executing = true; // OK, we are running
			osCmd.start();

			Thread.sleep(defaultWaitTime); // Allow some time for the thread to start

			// Wait for command to start 
			while (!osCmd.isStarted() && isExecuting())
				Thread.sleep(defaultWaitTime);

			// Wait for stdin to became available
			while ((osCmd.getStdin() == null) && isExecuting())
				Thread.sleep(defaultWaitTime);

			// Now the command started executing
			started = true;

			synchronized (this) {
				osCmd.setObjetcToNotify(this); // Notify me when done (i.e. the command finished)
				while (isExecuting())
					wait(defaultLoopWaitTime);
			}

		} catch (Throwable t) {
			error = t.toString();
			t.printStackTrace(); // Something happened? => Stop this thread
		} finally {
			exitValue = osCmd.getExitValue();
			close();
			executing = false;
			started = true;
		}
	}