arduino/Arduino — pull request #1945 by pbrook (2014-03-21 00:47:05+00:00)
Title: Fix race condition in USB CDC transmit

This patch fixes a race that can cause data corruption/loss when sending data over the USB CDC serial port. Exact details in commit message.

The window for the race condition is quite small, and the CDC code very slow (byte writes), so the hardware double buffering means this occurs extremely rarely for most sketches.

I have however seen it occur in real life.