Browse code

tm: removed async mutex define option

- it was disbaled due to conflict with reply processing, the reply mutex
being used, t_continue() has same processing like a failure handling

Daniel-Constantin Mierla authored on 30/09/2019 07:05:47
Showing 5 changed files
... ...
@@ -396,7 +396,6 @@ struct cell *build_cell(struct sip_msg *p_msg)
396 396
 
397 397
 	init_synonym_id(p_msg, new_cell->md5);
398 398
 	init_cell_lock(new_cell);
399
-	init_async_lock(new_cell);
400 399
 	t_stats_created();
401 400
 	return new_cell;
402 401
 
... ...
@@ -406,11 +406,6 @@ typedef struct cell
406 406
 	/* recursive reply lock count */
407 407
 	int reply_rec_lock_level;
408 408
 
409
-#ifdef ENABLE_ASYNC_MUTEX
410
-	/* protect against concurrent async continues */
411
-	ser_lock_t async_mutex;
412
-#endif
413
-
414 409
 	ticks_t fr_timeout;		/* final response interval for retr_bufs */
415 410
 	ticks_t fr_inv_timeout; /* final inv. response interval for retr_bufs */
416 411
 	retr_timeout_t rt_t1_timeout_ms; /* start retr. interval for retr_bufs */
... ...
@@ -50,9 +50,6 @@
50 50
 static int sem_nr;
51 51
 gen_lock_set_t *entry_semaphore = 0;
52 52
 gen_lock_set_t *reply_semaphore = 0;
53
-#ifdef ENABLE_ASYNC_MUTEX
54
-gen_lock_set_t *async_semaphore = 0;
55
-#endif
56 53
 #endif
57 54
 
58 55
 
... ...
@@ -82,12 +79,6 @@ again:
82 79
 			lock_set_destroy(reply_semaphore);
83 80
 			lock_set_dealloc(reply_semaphore);
84 81
 		}
85
-#ifdef ENABLE_ASYNC_MUTEX
86
-		if(async_semaphore != 0) {
87
-			lock_set_destroy(async_semaphore);
88
-			lock_set_dealloc(async_semaphore);
89
-		}
90
-#endif
91 82
 		if(i == 0) {
92 83
 			LOG(L_CRIT, "lock_initialize: could not allocate semaphore"
93 84
 						" sets\n");
... ...
@@ -139,20 +130,6 @@ again:
139 130
 		i--;
140 131
 		goto again;
141 132
 	}
142
-#ifdef ENABLE_ASYNC_MUTEX
143
-	i++;
144
-	if(((async_semaphore = lock_set_alloc(i)) == 0)
145
-			|| (lock_set_init(async_semaphore) == 0)) {
146
-		if(async_semaphore) {
147
-			lock_set_dealloc(async_semaphore);
148
-			async_semaphore = 0;
149
-		}
150
-		LM_DBG("async semaphore initialization failure: %s\n", strerror(errno));
151
-		probe_run = 1;
152
-		i--;
153
-		goto again;
154
-	}
155
-#endif
156 133
 
157 134
 	/* return success */
158 135
 	LM_INFO("semaphore arrays of size %d allocated\n", sem_nr);
... ...
@@ -192,13 +169,6 @@ void lock_cleanup()
192 169
 		lock_set_destroy(reply_semaphore);
193 170
 		lock_set_dealloc(reply_semaphore);
194 171
 	};
195
-#ifdef ENABLE_ASYNC_MUTEX
196
-	if(async_semaphore != 0) {
197
-		lock_set_destroy(async_semaphore);
198
-		lock_set_dealloc(async_semaphore);
199
-	}
200
-	async_semaphore = 0;
201
-#endif
202 172
 	entry_semaphore = reply_semaphore = 0;
203 173
 }
204 174
 #endif /*GEN_LOCK_T_PREFERED*/
... ...
@@ -232,22 +202,6 @@ int init_entry_lock(struct s_table *ht, struct entry *entry)
232 202
 	return 0;
233 203
 }
234 204
 
235
-int init_async_lock(struct cell *cell)
236
-{
237
-#ifdef ENABLE_ASYNC_MUTEX
238
-
239
-#ifdef GEN_LOCK_T_PREFERED
240
-	lock_init(&cell->async_mutex);
241
-#else
242
-	cell->async_mutex.semaphore_set = async_semaphore;
243
-	cell->async_mutex.semaphore_index = cell->hash_index % sem_nr;
244
-#endif /* GEN_LOCK_T_PREFERED */
245
-
246
-#endif /* ENABLE_ASYNC_MUTEX */
247
-
248
-	return 0;
249
-}
250
-
251 205
 int release_cell_lock(struct cell *cell)
252 206
 {
253 207
 #ifndef GEN_LOCK_T_PREFERED
... ...
@@ -56,7 +56,6 @@ void lock_cleanup(void);
56 56
 
57 57
 int init_cell_lock(struct cell *cell);
58 58
 int init_entry_lock(struct s_table *ht, struct entry *entry);
59
-int init_async_lock(struct cell *cell);
60 59
 
61 60
 
62 61
 int release_cell_lock(struct cell *cell);
... ...
@@ -41,13 +41,8 @@
41 41
 #include "../../core/data_lump_rpl.h"
42 42
 
43 43
 
44
-#ifdef ENABLE_ASYNC_MUTEX
45
-#define LOCK_ASYNC_CONTINUE(_t) lock(&(_t)->async_mutex )
46
-#define UNLOCK_ASYNC_CONTINUE(_t) unlock(&(_t)->async_mutex )
47
-#else
48 44
 #define LOCK_ASYNC_CONTINUE(_t) LOCK_REPLIES(_t)
49 45
 #define UNLOCK_ASYNC_CONTINUE(_t) UNLOCK_REPLIES(_t)
50
-#endif
51 46
 
52 47
 /* Suspends the transaction for later use.
53 48
  * Save the returned hash_index and label to get