summaryrefslogtreecommitdiff
path: root/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c
diff options
context:
space:
mode:
Diffstat (limited to 'open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c')
-rw-r--r--open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c b/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c
index 1dc8f5d2..d71315f8 100644
--- a/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c
+++ b/open-vm-tools/lib/hgfsServerManagerGuest/hgfsChannelGuest.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2010 VMware, Inc. All rights reserved.
+ * Copyright (C) 2010-2015 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -24,6 +24,7 @@
*/
#include <stdlib.h>
+#include "vm_basic_defs.h"
#include "vm_assert.h"
#include "vm_atomic.h"
#include "util.h"
@@ -147,7 +148,7 @@ static uint32
HgfsChannelGetServer(HgfsChannelServerData *serverInfo) // IN/OUT: ref count
{
ASSERT(NULL != serverInfo);
- return Atomic_FetchAndInc(&serverInfo->refCount);
+ return Atomic_ReadInc32(&serverInfo->refCount);
}
@@ -173,7 +174,7 @@ static void
HgfsChannelPutServer(HgfsChannelServerData *serverInfo) // IN/OUT: ref count
{
ASSERT(NULL != serverInfo);
- if (Atomic_FetchAndDec(&serverInfo->refCount) == 1) {
+ if (Atomic_ReadDec32(&serverInfo->refCount) == 1) {
HgfsChannelTeardownServer(serverInfo);
}
}
@@ -292,7 +293,7 @@ uint32
HgfsChannelGetChannel(HgfsChannelData *channel) // IN/OUT: ref count
{
ASSERT(NULL != channel);
- return Atomic_FetchAndInc(&channel->refCount);
+ return Atomic_ReadInc32(&channel->refCount);
}
@@ -318,7 +319,7 @@ static void
HgfsChannelPutChannel(HgfsChannelData *channel) // IN/OUT: ref count
{
ASSERT(NULL != channel);
- if (Atomic_FetchAndDec(&channel->refCount) == 1) {
+ if (Atomic_ReadDec32(&channel->refCount) == 1) {
HgfsChannelTeardownChannel(channel);
}
}