A decent tutorial on avoiding spurious wake up while using mutex:
http://www.justsoftwaresolutions.co.uk/threading/condition-variable-spurious-wakes.html
http://www.justsoftwaresolutions.co.uk/threading/condition-variable-spurious-wakes.html
register n = (count + 7) / 8;      /* count > 0 assumed */
   switch (count % 8)
   {
   case 0:        do {  *to = *from++;
   case 7:              *to = *from++;
   case 6:              *to = *from++;
   case 5:              *to = *from++;
   case 4:              *to = *from++;
   case 3:              *to = *from++;
   case 2:              *to = *from++;
   case 1:              *to = *from++;
                      } while (--n > 0);
   }
What it does is exactly same as:
send(to, from, count)
 register short *to, *from;
 register count;
 {
  do
   *to = *from++;
  while(--count>0);
 }
Dont worry about '*to' same pointer. it was originally coded for serial copying to one output port.
Details: http://drdobbs.com/web-development/184406208