Skip to content

Commit

Permalink
tm: removed async mutex define option
Browse files Browse the repository at this point in the history
- it was disbaled due to conflict with reply processing, the reply mutex
being used, t_continue() has same processing like a failure handling
  • Loading branch information
miconda committed Sep 30, 2019
1 parent a37f3fe commit de11e28
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 58 deletions.
1 change: 0 additions & 1 deletion src/modules/tm/h_table.c
Expand Up @@ -396,7 +396,6 @@ struct cell *build_cell(struct sip_msg *p_msg)

init_synonym_id(p_msg, new_cell->md5);
init_cell_lock(new_cell);
init_async_lock(new_cell);
t_stats_created();
return new_cell;

Expand Down
5 changes: 0 additions & 5 deletions src/modules/tm/h_table.h
Expand Up @@ -406,11 +406,6 @@ typedef struct cell
/* recursive reply lock count */
int reply_rec_lock_level;

#ifdef ENABLE_ASYNC_MUTEX
/* protect against concurrent async continues */
ser_lock_t async_mutex;
#endif

ticks_t fr_timeout; /* final response interval for retr_bufs */
ticks_t fr_inv_timeout; /* final inv. response interval for retr_bufs */
retr_timeout_t rt_t1_timeout_ms; /* start retr. interval for retr_bufs */
Expand Down
46 changes: 0 additions & 46 deletions src/modules/tm/lock.c
Expand Up @@ -50,9 +50,6 @@
static int sem_nr;
gen_lock_set_t *entry_semaphore = 0;
gen_lock_set_t *reply_semaphore = 0;
#ifdef ENABLE_ASYNC_MUTEX
gen_lock_set_t *async_semaphore = 0;
#endif
#endif


Expand Down Expand Up @@ -82,12 +79,6 @@ int lock_initialize()
lock_set_destroy(reply_semaphore);
lock_set_dealloc(reply_semaphore);
}
#ifdef ENABLE_ASYNC_MUTEX
if(async_semaphore != 0) {
lock_set_destroy(async_semaphore);
lock_set_dealloc(async_semaphore);
}
#endif
if(i == 0) {
LOG(L_CRIT, "lock_initialize: could not allocate semaphore"
" sets\n");
Expand Down Expand Up @@ -139,20 +130,6 @@ int lock_initialize()
i--;
goto again;
}
#ifdef ENABLE_ASYNC_MUTEX
i++;
if(((async_semaphore = lock_set_alloc(i)) == 0)
|| (lock_set_init(async_semaphore) == 0)) {
if(async_semaphore) {
lock_set_dealloc(async_semaphore);
async_semaphore = 0;
}
LM_DBG("async semaphore initialization failure: %s\n", strerror(errno));
probe_run = 1;
i--;
goto again;
}
#endif

/* return success */
LM_INFO("semaphore arrays of size %d allocated\n", sem_nr);
Expand Down Expand Up @@ -192,13 +169,6 @@ void lock_cleanup()
lock_set_destroy(reply_semaphore);
lock_set_dealloc(reply_semaphore);
};
#ifdef ENABLE_ASYNC_MUTEX
if(async_semaphore != 0) {
lock_set_destroy(async_semaphore);
lock_set_dealloc(async_semaphore);
}
async_semaphore = 0;
#endif
entry_semaphore = reply_semaphore = 0;
}
#endif /*GEN_LOCK_T_PREFERED*/
Expand Down Expand Up @@ -232,22 +202,6 @@ int init_entry_lock(struct s_table *ht, struct entry *entry)
return 0;
}

int init_async_lock(struct cell *cell)
{
#ifdef ENABLE_ASYNC_MUTEX

#ifdef GEN_LOCK_T_PREFERED
lock_init(&cell->async_mutex);
#else
cell->async_mutex.semaphore_set = async_semaphore;
cell->async_mutex.semaphore_index = cell->hash_index % sem_nr;
#endif /* GEN_LOCK_T_PREFERED */

#endif /* ENABLE_ASYNC_MUTEX */

return 0;
}

int release_cell_lock(struct cell *cell)
{
#ifndef GEN_LOCK_T_PREFERED
Expand Down
1 change: 0 additions & 1 deletion src/modules/tm/lock.h
Expand Up @@ -56,7 +56,6 @@ void lock_cleanup(void);

int init_cell_lock(struct cell *cell);
int init_entry_lock(struct s_table *ht, struct entry *entry);
int init_async_lock(struct cell *cell);


int release_cell_lock(struct cell *cell);
Expand Down
5 changes: 0 additions & 5 deletions src/modules/tm/t_suspend.c
Expand Up @@ -41,13 +41,8 @@
#include "../../core/data_lump_rpl.h"


#ifdef ENABLE_ASYNC_MUTEX
#define LOCK_ASYNC_CONTINUE(_t) lock(&(_t)->async_mutex )
#define UNLOCK_ASYNC_CONTINUE(_t) unlock(&(_t)->async_mutex )
#else
#define LOCK_ASYNC_CONTINUE(_t) LOCK_REPLIES(_t)
#define UNLOCK_ASYNC_CONTINUE(_t) UNLOCK_REPLIES(_t)
#endif

/* Suspends the transaction for later use.
* Save the returned hash_index and label to get
Expand Down

0 comments on commit de11e28

Please sign in to comment.