summaryrefslogtreecommitdiff
path: root/tirpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2014-01-23 11:17:09 -0500
committerSteve Dickson <steved@redhat.com>2014-01-23 11:27:44 -0500
commite63e2b5b89f338befc538c236e8530898fb74993 (patch)
treebf737761fb165345ad575388c84f31ad813a789b /tirpc
parent518c01c44b00e8941a27924c474c3a35c85fdcd4 (diff)
downloadti-rpc-e63e2b5b89f338befc538c236e8530898fb74993.tar.gz
Add a pthread key initializer constant
Clean up: replace the naked "-1" with a symbolic constant that helps document what is going on. The name matches the name of the other pthread initializer constants. Also, since pthread_key_t is an unsigned integer, use a type cast to eliminate the implicit cast that occurs every time foo_key is compared to -1. This eliminates a number of compiler warnings. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'tirpc')
-rw-r--r--tirpc/reentrant.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tirpc/reentrant.h b/tirpc/reentrant.h
index 9489b15..5f5c96e 100644
--- a/tirpc/reentrant.h
+++ b/tirpc/reentrant.h
@@ -46,6 +46,8 @@
#define once_t pthread_once_t
#define thread_key_t pthread_key_t
+
+#define KEY_INITIALIZER ((thread_key_t)-1)
#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
#define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER
#define ONCE_INITIALIZER PTHREAD_ONCE_INIT