This is an automated email from the ASF dual-hosted git repository.
oknet pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new f84b433 TS-5076: Test and set the in_enabled_list by atomic
function
f84b433 is described below
commit f84b4333d2743a8275f4974e32c733e989968a67
Author: Oknet Xu <[email protected]>
AuthorDate: Sat Dec 3 13:07:38 2016 +0800
TS-5076: Test and set the in_enabled_list by atomic function
---
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 ccfaa9a..31d4b9c 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -875,13 +875,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
['"[email protected]" <[email protected]>'].