trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [2/2] trafficserver git commit: Avoid a Coverity false positive on the rwlock initializer.
Date Wed, 07 Jan 2015 17:12:11 GMT
Avoid a Coverity false positive on the rwlock initializer.

Coverity CID #1021903


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a41b4fe5
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a41b4fe5
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a41b4fe5

Branch: refs/heads/master
Commit: a41b4fe5dd038a1c4b551a3c2bca3d3b8724226c
Parents: 70b0f23
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Wed Jan 7 10:10:43 2015 -0700
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Wed Jan 7 10:10:43 2015 -0700

----------------------------------------------------------------------
 lib/ts/ink_rwlock.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a41b4fe5/lib/ts/ink_rwlock.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_rwlock.cc b/lib/ts/ink_rwlock.cc
index 7047f83..bcbc70a 100644
--- a/lib/ts/ink_rwlock.cc
+++ b/lib/ts/ink_rwlock.cc
@@ -26,8 +26,9 @@
 
 //-------------------------------------------------------------------------
 // ink_rwlock_init
+//
+// Note: This should be called only once.
 //-------------------------------------------------------------------------
-
 int
 ink_rwlock_init(ink_rwlock * rw)
 {
@@ -35,10 +36,12 @@ ink_rwlock_init(ink_rwlock * rw)
 
   if ((result = ink_mutex_init(&rw->rw_mutex, NULL)) != 0)
     goto Lerror;
+
   ink_cond_init(&rw->rw_condreaders);
   ink_cond_init(&rw->rw_condwriters);
   rw->rw_nwaitreaders = 0;
   rw->rw_nwaitwriters = 0;
+  // coverity[missing_lock]
   rw->rw_refcount = 0;
   rw->rw_magic = RW_MAGIC;
 


Mime
View raw message