The queue now works, it is implmented in C and works using pthread_mutex and pthread_cond.
However I am begining to doubt that this is the correct approach because it doesn't solve the problem of sharing a variable between two threads
The current problem is that when the thread that put something on the queue goes out of scope it will null that SV on the queue.
It is interesting to note that Thread::Queue implments a Queue in pure perl using the thread semantic. Maybe that is a better approach, add in support for conditions and locks in perl, and then write iThread::Queue in pure perl.