I think the condition variables are right BUT SEG FAULT