From pthread_key_create FreeBSD man page:
/comment
... The
pthread_key_create()function creates a thread-specific data key visible to all threads in the process. Key values provided bypthread_key_create()are opaque objects used to locate thread-specific data. Although the same key value may be used by different threads, the values bound to the key bypthread_setspecific()are maintained on a per-thread basis and persist for the life of the calling thread.
I am assuming that produced pthread_key_t instances are bound to a process (hence the opaque word in the man page), and that these become invalid after a fork(). I couldn't find any reference in existing man pages or documentation however.
Can anyone confirm/comment?