From: Jeffrey Altman Date: Fri, 2 Dec 2011 18:21:24 +0000 (-0500) Subject: Windows: use interlocked increment on cm_buf_t refcnt X-Git-Tag: upstream/1.8.0_pre1^2~2988 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6ee14eef3679fbcdecfe6b1d7879309c9360bb61;p=packages%2Fo%2Fopenafs.git Windows: use interlocked increment on cm_buf_t refcnt For consistency use interlocked increment when setting the cm_buf_t refCnt to 1 even though it is protected by a lock. Change-Id: I91fbb1469715ee6b7d6f94f416c59ebcd1645336 Reviewed-on: http://gerrit.openafs.org/6175 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index ac402f5f8..142342d18 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -1474,7 +1474,7 @@ long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *req buf_DecrementFreeCount(); /* prepare to return it. Give it a refcount */ - bp->refCount = 1; + InterlockedIncrement(&bp->refCount); #ifdef DEBUG_REFCOUNT osi_Log2(afsd_logp,"buf_GetNewLocked bp 0x%p ref %d", bp, 1); afsi_log("%s:%d buf_GetNewLocked bp 0x%p, ref %d", __FILE__, __LINE__, bp, 1);