pthread_key_create

It would seem to be wrong to create the key in one thread (main), and then try and share it in other threads (child1,child2).