Please sign in to comment.
Fix Application#trace which would interleave CR in a multi-threaded c…
…ontext. Running rake with tracing on and executing multitasks would show a trace with multiple traces on a single line and other lines having multiple CRs. This is because #trace used IO#puts behind the scenes. IO#puts first calls #write with the string, followed by another #write with the CR. Because of the gap in-between calls, another thread could sneak in a CR or another string. The fix is to make sure calls to trace create a single string with a CR appended before calling IO#print. This will output a single string with a trailing CR in thread-safe way. Example output showing the error: ** Execute 98** Execute 68** Execute 69 ** Execute 74 ** Execute 78** Execute 81 ** Execute 84** Execute 100 ** Execute 89
- Loading branch information...
Showing with 51 additions and 1 deletion.