Currently, the output in xend.trace is sometimes garbled since multiple threads write to it simultaneously. The following patch fixes that. It also adds an initial field with the thread name on each traced line, which makes it easier to follow the trace. (If this is considered a new feature which shouldn't be included due to the feature freeze, it can be disabled by removing the first line in print_trace.) Cheers, Magnus