Skip to content

Commit

Permalink
b2b_entities: fix possible deadlock
Browse files Browse the repository at this point in the history
Fix deadlock generated when a dialog is terminated on the 200 OK
callback
  • Loading branch information
razvancrainea committed Aug 8, 2022
1 parent 05beec1 commit d19fb1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/b2b_entities/dlg.c
Expand Up @@ -3395,8 +3395,10 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
b2b_ev = B2B_EVENT_UPDATE;
b2b_run_cb(dlg, hash_index, etype, B2BCB_TRIGGER_EVENT, b2b_ev,
&storage, serialize_backend);
} else
} else {
b2b_ev = -1;
B2BE_LOCK_RELEASE(htable, hash_index);
}
} else if (b2b_ev == B2B_EVENT_CREATE) {
B2BE_LOCK_GET(htable, hash_index);

Expand All @@ -3406,8 +3408,10 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)

if (b2be_db_mode == WRITE_THROUGH)
b2be_db_insert(dlg, etype);
} else
} else {
b2b_ev = -1;
B2BE_LOCK_RELEASE(htable, hash_index);
}
}
}

Expand Down

0 comments on commit d19fb1b

Please sign in to comment.