|
37 | 37 | #include "b2be_clustering.h"
|
38 | 38 | #include "b2b_entities.h"
|
39 | 39 | #include "b2be_db.h"
|
| 40 | +#include "../../pt.h" |
40 | 41 |
|
41 | 42 | #define NO_REPL_CONSTANT_STRS 10
|
42 | 43 |
|
@@ -453,9 +454,12 @@ int receive_entity_create(bin_packet_t *packet, b2b_dlg_t *dlg, int type,
|
453 | 454 | new_dlg->legs = new_leg;
|
454 | 455 |
|
455 | 456 | lock_get(&htable[h_idx].lock);
|
| 457 | + htable[h_idx].locked_by = process_no; |
456 | 458 |
|
457 | 459 | b2b_run_cb(new_dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_CREATE, packet);
|
458 | 460 |
|
| 461 | + htable[h_idx].locked_by = -1; |
| 462 | + |
459 | 463 | new_key = b2b_htable_insert(htable, new_dlg, hash_index, type, 1, 1);
|
460 | 464 | if (new_key == NULL) {
|
461 | 465 | LM_ERR("Failed to insert new record\n");
|
@@ -547,7 +551,9 @@ int receive_entity_update(bin_packet_t *packet)
|
547 | 551 | if (packet->type == REPL_ENTITY_UPDATE) {
|
548 | 552 | unpack_update_fields(packet, dlg);
|
549 | 553 |
|
| 554 | + htable[hash_index].locked_by = process_no; |
550 | 555 | b2b_run_cb(dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_UPDATE, packet);
|
| 556 | + htable[hash_index].locked_by = -1; |
551 | 557 | } else {
|
552 | 558 | rc = recv_b2bl_param_update(packet, dlg);
|
553 | 559 | }
|
@@ -601,7 +607,9 @@ int receive_entity_delete(bin_packet_t *packet)
|
601 | 607 | return 0;
|
602 | 608 | }
|
603 | 609 |
|
| 610 | + htable[hash_index].locked_by = process_no; |
604 | 611 | b2b_run_cb(dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_DELETE, packet);
|
| 612 | + htable[hash_index].locked_by = -1; |
605 | 613 |
|
606 | 614 | b2b_entity_db_delete(type, dlg);
|
607 | 615 | b2b_delete_record(dlg, htable, hash_index);
|
|
0 commit comments