[Asterisk-code-review] db: Initialize condition primitive before use (asterisk[master])

Friendly Automation asteriskteam at digium.com
Mon Dec 30 15:16:49 CST 2019


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13523 )

Change subject: db: Initialize condition primitive before use
......................................................................

db: Initialize condition primitive before use

The db_init() function ultimately calls db_sync() which signals the
condition before it is initialized.

Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab
---
M main/db.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/main/db.c b/main/db.c
index e74c46b..d4479f4 100644
--- a/main/db.c
+++ b/main/db.c
@@ -1081,11 +1081,12 @@
 
 int astdb_init(void)
 {
+	ast_cond_init(&dbcond, NULL);
+
 	if (db_init()) {
 		return -1;
 	}
 
-	ast_cond_init(&dbcond, NULL);
 	if (ast_pthread_create_background(&syncthread, NULL, db_sync_thread, NULL)) {
 		return -1;
 	}

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab
Gerrit-Change-Number: 13523
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191230/2ef4bb38/attachment.html>


More information about the asterisk-code-review mailing list