parlib: Fix potential races with DTLS
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 Mar 2017 17:56:21 +0000 (12:56 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 Mar 2017 18:01:29 +0000 (13:01 -0500)
commit3e180064e3b832d33e36f2a0cf728832cf6c2b55
treec1c66c13b14e3efda9fa0c6cb75fb3ed7ccc53b3
parent2ee62d285f561d04df18f06b912a4b25a2e3b660
parlib: Fix potential races with DTLS

I didn't see these happen, but stumbled on them as possibilities during
other bug hunts.

The DTLS one sounds a lot like a problem with glibc's version.  For the
pthread code, I'm being a little paranoid.  pthread_cleanup_pop() will call
free(), which also might want to use the DTLS.  free() should be able to
handle things if the key is deleted, but who knows.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/dtls.c
user/pthread/pthread.c