Bug 536943 - give the reader thread a chance to start reading

Added a wait in OutputStreamMonitor.getContents(), until stream reading
is done or until a timeout of default 10 seconds occurs. If the timeout
is reached before stream reading is done, a warning is logged.

The timeout can be configured by specifying VM property:

-Dorg.eclipse.debug.core.msMaxWaitTimeForStreamMonitorReading=5000

The VM property time unit is milliseconds.

The wait ensures that callers of OutputStreamMonitor.getContents()
actually see correct stream contents in cases such as accessing contents
before the reading has even started, which could cause bug 536943.

Change-Id: I7e4af3d06ef528030df5b263b3d664b853f12456
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
1 file changed