Drafted the key mechanism for POSIX threads

I don not know how to implement keys on threads. I have written a piece
of code to figure out how key can be correctly implemented.