Fix assumption about queue order. Fixes #216 .
Fix assumption about queue order. Fixes #216 .

The mpmc queue can fill slots out of order if a context switch occurs
between "reserving" a slot and marking that slot as filled.

So, insertion into slot 2 can look successful (and cause mio to
increment its own queue length counts) before an insertion into slot 1
is fully committed.

So, then when mio actually reads the queue, it gets None, because
slot 1, the "next" slot, isn't completely done yet.  Yielding the
scheduler to other threads will allow the partially-committed slot
to finish committing, and the queue will eventually be seen as having
both elements, slots 1 and 2.

yangxingpping/mio,yuikns/mio,carllerche/mio,danburkert/mio,echochamber/mio,geofft/mio,frewsxcv/mio,marjakm/mio,greensnark/mio,mneumann/mio,rrichardson/mio,arthurprs/mio,asomers/mio,mlalic/mio,murarth/mio,zslayton/mio,bottompawn/mio,alexcrichton/mio,rryan/mio,fuchsia-mirror/third_party-mio,tempbottle/mio,mneumann/mio,dpc/mio,tailhook/mio,fhartwig/mio,luca-barbieri/mio,fuchsia-mirror/third_party-mio,carllerche/mio,dwrensha/mio,asomers/mio