Glut + Pthread

Hi guys, i'm a beginner about open gl, but during this week i learned the basic about it... So hmmmmm i would like to program with two distinct windows, which shows their own drawn with their own input handler. So i tried this code...

but it doesn't work...my idea was to make a thread for a single window, but the prompt show me a context problem... or it doesn't work well... you will understand me if you try this code... can you help me?