trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] branch 7.0.x updated: TS-5076: Test and set the in_enabled_list by atomic function
Date Tue, 24 Jan 2017 04:52:33 GMT
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/7.0.x by this push:
       new  444c490   TS-5076: Test and set the in_enabled_list by atomic function
444c490 is described below

commit 444c490a2b6dff29966034d0f94618f9582db813
Author: Oknet Xu <xuchao@skyguard.com.cn>
AuthorDate: Sat Dec 3 13:07:38 2016 +0800

    TS-5076: Test and set the in_enabled_list by atomic function
    
    (cherry picked from commit f84b4333d2743a8275f4974e32c733e989968a67)
---
 iocore/net/UnixNetVConnection.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index bd07ae6..fe24947 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -816,13 +816,13 @@ UnixNetVConnection::reenable(VIO *vio)
     MUTEX_TRY_LOCK(lock, nh->mutex, t);
     if (!lock.is_locked()) {
       if (vio == &read.vio) {
-        if (!read.in_enabled_list) {
-          read.in_enabled_list = 1;
+        int isin = ink_atomic_swap(&read.in_enabled_list, 1);
+        if (!isin) {
           nh->read_enable_list.push(this);
         }
       } else {
-        if (!write.in_enabled_list) {
-          write.in_enabled_list = 1;
+        int isin = ink_atomic_swap(&write.in_enabled_list, 1);
+        if (!isin) {
           nh->write_enable_list.push(this);
         }
       }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message