From 3f21ac29288c2e1a3a9285623e7ea61f2b400ee6 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 14 Dec 2005 05:42:08 +0000 Subject: the beatings will continue until morale improves --- lib/librthread/rthread_tls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/librthread/rthread_tls.c b/lib/librthread/rthread_tls.c index e510aa589b5..05311c11d7e 100644 --- a/lib/librthread/rthread_tls.c +++ b/lib/librthread/rthread_tls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_tls.c,v 1.4 2005/12/14 05:38:31 tedu Exp $ */ +/* $OpenBSD: rthread_tls.c,v 1.5 2005/12/14 05:42:07 tedu Exp $ */ /* * Copyright (c) 2004 Ted Unangst * All Rights Reserved. @@ -72,6 +72,9 @@ int pthread_key_delete(pthread_key_t key) { + if (rkeys[key].used) + return (EINVAL); + _spinlock(&rkeyslock); rkeys[key].used = 0; rkeys[key].destructor = NULL; -- cgit v1.2.3