[Asterisk-code-review] astobj2: Comment on OBJ NOLOCK in ao2 container clone. (asterisk[13])

George Joseph asteriskteam at digium.com
Thu Oct 4 07:25:12 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10390 )

Change subject: astobj2: Comment on OBJ_NOLOCK in ao2_container_clone.
......................................................................

astobj2: Comment on OBJ_NOLOCK in ao2_container_clone.

The test for OBJ_NOLOCK looks wrong but it isn't.  Add comments to
prevent confusion.

Change-Id: I9662b82eb39e7627a1f1944fd18f967a2b987344
---
M main/astobj2_container.c
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  George Joseph: Approved for Submit



diff --git a/main/astobj2_container.c b/main/astobj2_container.c
index ec9db3b..27d5558 100644
--- a/main/astobj2_container.c
+++ b/main/astobj2_container.c
@@ -768,6 +768,9 @@
 		return NULL;
 	}
 
+	/* This test is correct.  clone must be locked before calling
+	 * ao2_container_dup when the OBJ_NOLOCK flag is set, otherwise
+	 * we could have errors in __adjust_lock. */
 	if (flags & OBJ_NOLOCK) {
 		ao2_wrlock(clone);
 	}

-- 
To view, visit https://gerrit.asterisk.org/10390
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I9662b82eb39e7627a1f1944fd18f967a2b987344
Gerrit-Change-Number: 10390
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181004/e8564e8a/attachment.html>


More information about the asterisk-code-review mailing list