diff options
Diffstat (limited to 'rpc/rpc-lib/src/rpc-transport.c')
-rw-r--r-- | rpc/rpc-lib/src/rpc-transport.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c index 40b5917f9b8..40c41ab7016 100644 --- a/rpc/rpc-lib/src/rpc-transport.c +++ b/rpc/rpc-lib/src/rpc-transport.c @@ -493,11 +493,7 @@ rpc_transport_ref (rpc_transport_t *this) GF_VALIDATE_OR_GOTO("rpc_transport", this, fail); - pthread_mutex_lock (&this->lock); - { - this->refcount ++; - } - pthread_mutex_unlock (&this->lock); + GF_ATOMIC_INC (this->refcount); return_this = this; fail: @@ -513,11 +509,7 @@ rpc_transport_unref (rpc_transport_t *this) GF_VALIDATE_OR_GOTO("rpc_transport", this, fail); - pthread_mutex_lock (&this->lock); - { - refcount = --this->refcount; - } - pthread_mutex_unlock (&this->lock); + refcount = GF_ATOMIC_DEC (this->refcount); if (refcount == 0) { if (this->mydata) |