From 6ee14eef3679fbcdecfe6b1d7879309c9360bb61 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 2 Dec 2011 13:21:24 -0500 Subject: [PATCH] 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 --- src/WINNT/afsd/cm_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5