Basic attempt at a ringbuffer

It's wrong.
basic failed first attempt at a pthread using ringbuffer

it crashes. sometimes. It's late.

There are many other choices out there for ringbuffer code. (but
the three I'm most familiar with are GPL'd)

I'd liked the idea of making a typesafe one using clever C macros

https://github.com/dtaht/c-generic-ring-buffer

or one that used a clever mmap trick

http://en.wikipedia.org/wiki/Circular_buffer#Optimized_POSIX_implementation

but I'd settle for one that doesn't crash under pthreads. I've
not seen the the gnu __sync macros before, always used assembly...
Merge branch 'master' of github.com:dtaht/twd