<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11618">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_config_sqlite3: Only join threads that we started<br><br>ASTERISK-28477 #close<br>Reported by: Dennis<br><br>ASTERISK-28478 #close<br>Reported by: Dennis<br><br>Change-Id: I77347ad46a86dc5b35ed68270cee56acefb4f475<br>---<br>M res/res_config_sqlite3.c<br>1 file changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/18/11618/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_config_sqlite3.c b/res/res_config_sqlite3.c</span><br><span>index 6148d5d..d321cb7 100644</span><br><span>--- a/res/res_config_sqlite3.c</span><br><span>+++ b/res/res_config_sqlite3.c</span><br><span>@@ -104,6 +104,7 @@</span><br><span> unsigned int debug:1;</span><br><span> unsigned int exiting:1;</span><br><span> unsigned int wakeup:1;</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned int has_batch_thread:1;</span><br><span> unsigned int batch;</span><br><span> };</span><br><span> </span><br><span>@@ -368,13 +369,14 @@</span><br><span> if (db->batch) {</span><br><span> ast_cond_init(&db->cond, NULL);</span><br><span> ao2_ref(db, +1);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_pthread_create_background(&db->syncthread, NULL, db_sync_thread, db);</span><br><span style="color: hsl(120, 100%, 40%);">+ db->has_batch_thread = !ast_pthread_create_background(&db->syncthread, NULL, db_sync_thread, db);</span><br><span> }</span><br><span> }</span><br><span> </span><br><span> void db_stop_batch(struct realtime_sqlite3_db *db)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- if (db->batch) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (db->has_batch_thread) {</span><br><span style="color: hsl(120, 100%, 40%);">+ db->has_batch_thread = 0;</span><br><span> db->exiting = 1;</span><br><span> db_sync(db);</span><br><span> pthread_join(db->syncthread, NULL);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11618">change 11618</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11618"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I77347ad46a86dc5b35ed68270cee56acefb4f475 </div>
<div style="display:none"> Gerrit-Change-Number: 11618 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>