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

George Joseph asteriskteam at digium.com
Tue Dec 31 08:36:20 CST 2019


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13504 )

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; Approved for Submit



diff --git a/main/db.c b/main/db.c
index 4d1b372..193bd2e 100644
--- a/main/db.c
+++ b/main/db.c
@@ -1083,11 +1083,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/+/13504
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab
Gerrit-Change-Number: 13504
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/20191231/cc7a1dfe/attachment.html>


More information about the asterisk-code-review mailing list