Fixed compile error, added producer and consumer thread structure