mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 16:55:10 +00:00
[FIX] Fix potential race condition
This commit is contained in:
parent
c975dba852
commit
1f747dd016
1 changed files with 3 additions and 0 deletions
|
|
@ -331,6 +331,7 @@ ParseeAwaitStanza(char *identifier, int64_t timeout)
|
|||
{
|
||||
/* Timeout detected, give up regardless of the status of our
|
||||
* search. */
|
||||
pthread_mutex_lock(&await_lock);
|
||||
HashMapDelete(await_table, identifier);
|
||||
pthread_mutex_unlock(&await_lock);
|
||||
break;
|
||||
|
|
@ -344,7 +345,9 @@ ParseeAwaitStanza(char *identifier, int64_t timeout)
|
|||
stanza = awa.stanza;
|
||||
pthread_mutex_unlock(&awa.cond_lock);
|
||||
|
||||
pthread_mutex_lock(&await_lock);
|
||||
pthread_cond_destroy(&awa.condition);
|
||||
pthread_mutex_destroy(&awa.cond_lock);
|
||||
pthread_mutex_unlock(&await_lock);
|
||||
return stanza;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue