Browse code

- added fast_locking to tm (and changed lock & unlock call syntax)

Andrei Pelinescu-Onciul authored on 21/02/2002 20:04:53
Showing 9 changed files
... ...
@@ -7,8 +7,8 @@
7 7
 #version number
8 8
 VERSION = 0
9 9
 PATCHLEVEL = 8
10
-SUBLEVEL = 6
11
-EXTRAVERSION = -6-beer
10
+SUBLEVEL = 7
11
+EXTRAVERSION = -0-unstable
12 12
 
13 13
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
14 14
 OS = $(shell uname -s)
... ...
@@ -59,8 +59,8 @@ ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
59 59
 DEFS+= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
60 60
 	 -DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
61 61
 	 -DDNS_IP_HACK  -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP \
62
-	 -DF_MALLOC  #-DUSE_SYNONIM\
63
-	 #-DNO_DEBUG
62
+	 -DF_MALLOC  -DUSE_SYNONIM\
63
+	 -DNO_DEBUG
64 64
 	 #-DEXTRA_DEBUG 
65 65
 	 #-DVQ_MALLOC  -DDBG_LOCK  #-DSTATS
66 66
 	 #-DDBG_QM_MALLOC #-DNO_DEBUG
... ...
@@ -206,9 +206,9 @@ void    insert_into_hash_table_unsafe( struct s_table *hash_table,  struct cell
206 206
 
207 207
 void insert_into_hash_table( struct s_table *hash_table,  struct cell * p_cell )
208 208
 {
209
-	lock( hash_table->entrys[ p_cell->hash_index ].mutex );
209
+	lock( &(hash_table->entrys[ p_cell->hash_index ].mutex) );
210 210
 	insert_into_hash_table_unsafe( hash_table,  p_cell );
211
-	unlock( hash_table->entrys[ p_cell->hash_index ].mutex );
211
+	unlock( &(hash_table->entrys[ p_cell->hash_index ].mutex) );
212 212
 }
213 213
 
214 214
 
... ...
@@ -221,7 +221,7 @@ void remove_from_hash_table( struct s_table *hash_table,  struct cell * p_cell )
221 221
    struct entry*  p_entry  = &(hash_table->entrys[p_cell->hash_index]);
222 222
 
223 223
    /* unlink the cell from entry list */
224
-   lock( p_entry->mutex );
224
+   lock( &(p_entry->mutex) );
225 225
 
226 226
    if ( p_cell->prev_cell )
227 227
       p_cell->prev_cell->next_cell = p_cell->next_cell;
... ...
@@ -233,7 +233,7 @@ void remove_from_hash_table( struct s_table *hash_table,  struct cell * p_cell )
233 233
    else
234 234
       p_entry->last_cell = p_cell->prev_cell;
235 235
 
236
-   unlock( p_entry->mutex );
236
+   unlock( &(p_entry->mutex) );
237 237
 }
238 238
 
239 239
 
... ...
@@ -9,7 +9,12 @@
9 9
 #include "timer.h"
10 10
 #include "../../dprint.h"
11 11
 
12
+#ifdef FAST_LOCK
13
+#include "../../mem/shm_mem.h"
14
+#endif
15
+
12 16
 
17
+#ifndef FAST_LOCK
13 18
 /* semaphore probing limits */
14 19
 #define SEM_MIN		16
15 20
 #define SEM_MAX		4096
... ...
@@ -23,6 +28,8 @@
23 28
    ipc's dimensioning limitations and will provide us with
24 29
    fast unlimited (=no sharing) mutexing
25 30
 
31
+  UPDATE: we do have now arch-dependent locking (-DFAST_LOCK)
32
+
26 33
    we allocate the locks according to the following plans:
27 34
 
28 35
    1) transaction timer lists have each a semaphore in
... ...
@@ -51,11 +58,75 @@ static int sem_nr;
51 58
 ser_lock_t timer_group_lock[TG_NR];
52 59
 
53 60
 
61
+/* return -1 if semget failed, -2 if semctl failed */
62
+static int init_semaphore_set( int size )
63
+{
64
+	int new_semaphore, i;
65
+
66
+	new_semaphore=semget ( IPC_PRIVATE, size, IPC_CREAT | IPC_PERMISSIONS );
67
+	if (new_semaphore==-1) {
68
+		DBG("DEBUG: init_semaphore_set(%d):  failure to allocate a"
69
+					" semaphore: %s\n", size, strerror(errno));
70
+		return -1;
71
+	}
72
+	for (i=0; i<size; i++) {
73
+                union semun {
74
+                        int val;
75
+                        struct semid_ds *buf;
76
+                        ushort *array;
77
+                } argument;
78
+                /* binary lock */
79
+                argument.val = +1;
80
+                if (semctl( new_semaphore, i , SETVAL , argument )==-1) {
81
+			DBG("DEBUG: init_semaphore_set:  failure to "
82
+						"initialize a semaphore: %s\n", strerror(errno));
83
+			if (semctl( entry_semaphore, 0 , IPC_RMID , 0 )==-1)
84
+				DBG("DEBUG: init_semaphore_set:  failure to release"
85
+						" a semaphore\n");
86
+			return -2;
87
+                }
88
+        }
89
+	return new_semaphore;
90
+}
54 91
 
55
-/* intitialize the locks; return 0 on success, -1 otherwise
56
-*/
57 92
 
58 93
 
94
+static int change_semaphore( ser_lock_t* s  , int val )
95
+{
96
+	struct sembuf pbuf;
97
+	int r;
98
+
99
+	pbuf.sem_num = s->semaphore_index ;
100
+	pbuf.sem_op =val;
101
+	pbuf.sem_flg = 0;
102
+
103
+tryagain:
104
+	r=semop( s->semaphore_set, &pbuf ,  1 /* just 1 op */ );
105
+
106
+	if (r==-1) {
107
+		if (errno==EINTR) {
108
+			DBG("signal received in a semaphore\n");
109
+			goto tryagain;
110
+		} else {
111
+			LOG(L_CRIT, "ERROR: change_semaphore(%x, %x, 1) : %s\n",
112
+					s->semaphore_set, &pbuf,
113
+					strerror(errno));
114
+		}
115
+	}
116
+	return r;
117
+}
118
+#endif  /* !FAST_LOCK*/
119
+
120
+
121
+
122
+/* intitialize the locks; return 0 on success, -1 otherwise
123
+*/
124
+#ifdef FAST_LOCK
125
+int lock_initialize()
126
+{
127
+	return 0;
128
+}
129
+#else
59 130
 int lock_initialize()
60 131
 {
61 132
 	int i;
... ...
@@ -169,38 +240,16 @@ error:
169 240
 	return -1;
170 241
 }
171 242
 
172
-/* return -1 if semget failed, -2 if semctl failed */
173
-static int init_semaphore_set( int size )
174
-{
175
-	int new_semaphore, i;
243
+#endif /*FAST_LOCK*/
176 244
 
177
-	new_semaphore=semget ( IPC_PRIVATE, size, IPC_CREAT | IPC_PERMISSIONS );
178
-	if (new_semaphore==-1) {
179
-		DBG("DEBUG: init_semaphore_set(%d):  failure to allocate a"
180
-					" semaphore: %s\n", size, strerror(errno));
181
-		return -1;
182
-	}
183
-	for (i=0; i<size; i++) {
184
-                union semun {
185
-                        int val;
186
-                        struct semid_ds *buf;
187
-                        ushort *array;
188
-                } argument;
189
-                /* binary lock */
190
-                argument.val = +1;
191
-                if (semctl( new_semaphore, i , SETVAL , argument )==-1) {
192
-			DBG("DEBUG: init_semaphore_set:  failure to "
193
-						"initialize a semaphore: %s\n", strerror(errno));
194
-			if (semctl( entry_semaphore, 0 , IPC_RMID , 0 )==-1)
195
-				DBG("DEBUG: init_semaphore_set:  failure to release"
196
-						" a semaphore\n");
197
-			return -2;
198
-                }
199
-        }
200
-	return new_semaphore;
245
+#ifdef FAST_LOCK
246
+void lock_cleanup()
247
+{
248
+	/* must check if someone uses them, for now just leave them allocated*/
249
+	LOG(L_INFO, "INFO: lock_cleanup:  clean-up still not implemented properly \n");
201 250
 }
202 251
 
203
-
252
+#else
204 253
 
205 254
 /* remove the semaphore set from system */
206 255
 void lock_cleanup()
... ...
@@ -229,71 +278,66 @@ void lock_cleanup()
229 278
 	entry_semaphore = timer_semaphore = reply_semaphore = ack_semaphore = 0;
230 279
 
231 280
 }
232
-
281
+#endif /*FAST_LOCK*/
233 282
 
234 283
 
235 284
 /* lock sempahore s */
236 285
 #ifdef DBG_LOCK
237
-inline int _lock( ser_lock_t s , char *file, char *function, unsigned int line )
286
+inline int _lock( ser_lock_t* s , char *file, char *function, unsigned int line )
238 287
 #else
239
-inline int _lock( ser_lock_t s )
288
+inline int _lock( ser_lock_t* s )
240 289
 #endif
241 290
 {
242 291
 #ifdef DBG_LOCK
243 292
 	DBG("DEBUG: lock : entered from %s , %s(%d)\n", function, file, line );
244 293
 #endif
294
+#ifdef FAST_LOCK
295
+	get_lock(s);
296
+	return 0;
297
+#else
245 298
 	return change_semaphore( s, -1 );
299
+#endif
246 300
 }
247 301
 
248 302
 #ifdef DBG_LOCK
249
-inline int _unlock( ser_lock_t s, char *file, char *function, unsigned int line )
303
+inline int _unlock( ser_lock_t* s, char *file, char *function, unsigned int line )
250 304
 #else
251
-inline int _unlock( ser_lock_t s )
305
+inline int _unlock( ser_lock_t* s )
252 306
 #endif
253 307
 {
254 308
 #ifdef DBG_LOCK
255 309
 	DBG("DEBUG: unlock : entered from %s, %s:%d\n", file, function, line );
256 310
 #endif
257
-	
311
+#ifdef FAST_LOCK
312
+	release_lock(s);
313
+	return 0;
314
+#else
258 315
 	return change_semaphore( s, +1 );
316
+#endif
259 317
 }
260 318
 
261
-static int change_semaphore( ser_lock_t s  , int val )
262
-{
263
-	struct sembuf pbuf;
264
-	int r;
265
-
266
-	pbuf.sem_num = s.semaphore_index ;
267
-	pbuf.sem_op =val;
268
-	pbuf.sem_flg = 0;
269
-
270
-tryagain:
271
-	r=semop( s.semaphore_set, &pbuf ,  1 /* just 1 op */ );
272
-
273
-	if (r==-1) {
274
-		if (errno==EINTR) {
275
-			DBG("signal received in a semaphore\n");
276
-			goto tryagain;
277
-		} else {
278
-			LOG(L_CRIT, "ERROR: change_semaphore(%x, %x, 1) : %s\n",
279
-					s.semaphore_set, &pbuf,
280
-					strerror(errno));
281
-		}
282
-	}
283
-	return r;
284
-}
285 319
 
286 320
 
287 321
 int init_cell_lock( struct cell *cell )
288 322
 {
323
+#ifdef FAST_LOCK
324
+	init_lock(cell->reply_mutex);
325
+	init_lock(cell->ack_mutex);
326
+	return 0;
327
+#else
289 328
 	cell->reply_mutex.semaphore_set=reply_semaphore;
290 329
 	cell->reply_mutex.semaphore_index = cell->hash_index % sem_nr;
291 330
 	cell->ack_mutex.semaphore_set=ack_semaphore;
292 331
 	cell->ack_mutex.semaphore_index = cell->hash_index % sem_nr;
332
+#endif
333
+	return 0;
293 334
 }
294 335
 
295 336
 int init_entry_lock( struct s_table* hash_table, struct entry *entry )
296 337
 {
338
+#ifdef FAST_LOCK
339
+	init_lock(entry->mutex);
340
+#else
297 341
 	/* just advice which of the available semaphores to use;
298 342
 	   specifically, all entries are partitioned into as
299 343
 	   many partitions as number of available semaphors allows
... ...
@@ -301,11 +345,15 @@ int init_entry_lock( struct s_table* hash_table, struct entry *entry )
301 345
 	entry->mutex.semaphore_set=entry_semaphore;
302 346
 	entry->mutex.semaphore_index = ( ((void *)entry - (void *)(hash_table->entrys ) )
303 347
                / sizeof(struct entry) ) % sem_nr;
304
-
348
+#endif
349
+	return 0;
305 350
 }
306 351
 
307 352
 int init_timerlist_lock( struct s_table* hash_table, enum lists timerlist_id)
308 353
 {
354
+#ifdef FAST_LOCK
355
+	init_lock(hash_table->timers[timerlist_id].mutex);
356
+#else
309 357
 	/* each timer list has its own semaphore */
310 358
 	/*
311 359
 	hash_table->timers[timerlist_id].mutex.semaphore_set=timer_semaphore;
... ...
@@ -313,22 +361,35 @@ int init_timerlist_lock( struct s_table* hash_table, enum lists timerlist_id)
313 361
 	*/
314 362
 
315 363
 	hash_table->timers[timerlist_id].mutex=timer_group_lock[ timer_group[timerlist_id] ];
364
+#endif
365
+	return 0;
316 366
 }
317 367
 
368
+
369
+
318 370
 int release_cell_lock( struct cell *cell )
319 371
 {
372
+#ifndef FAST_LOCK
320 373
 	/* don't do anything here -- the init_*_lock procedures
321 374
 	   just advised on usage of shared semaphores but did not
322 375
 	   generate them
323 376
 	*/
377
+#endif
378
+	return 0;
324 379
 }
325 380
 
381
+
382
+
326 383
 int release_entry_lock( struct entry *entry )
327 384
 {
328 385
 	/* the same as above */
386
+	return 0;
329 387
 }
330 388
 
331
-release_timerlist_lock( struct timer *timerlist )
389
+
390
+
391
+int release_timerlist_lock( struct timer *timerlist )
332 392
 {
333 393
 	/* the same as above */
394
+	return 0;
334 395
 }
... ...
@@ -11,12 +11,22 @@
11 11
 #include <sys/sem.h>
12 12
 
13 13
 
14
+
15
+#ifdef  FAST_LOCK
16
+#include "../../fastlock.h"
17
+#endif
18
+
19
+#ifdef FAST_LOCK
20
+#define ser_lock_t fl_lock_t
21
+#else
14 22
 /* typedef to structure we use for mutexing;
15 23
    currently, index to a semaphore set identifier now */
16 24
 typedef struct {
17 25
 	int semaphore_set;
18 26
 	int semaphore_index;
19 27
 } ser_lock_t;
28
+#endif
29
+
20 30
 
21 31
 enum timer_groups {
22 32
 	TG_FR,
... ...
@@ -26,7 +36,8 @@ enum timer_groups {
26 36
 	TG_NR
27 37
 };
28 38
 
29
-extern ser_lock_t timer_group_lock[TG_NR];
39
+
40
+/* extern ser_lock_t timer_group_lock[TG_NR]; */
30 41
 
31 42
 
32 43
 #include "h_table.h"
... ...
@@ -37,23 +48,30 @@ extern ser_lock_t timer_group_lock[TG_NR];
37 48
 
38 49
 
39 50
 int lock_initialize();
40
-static int init_semaphore_set( int size );
41 51
 void lock_cleanup();
42
-
52
+/*
53
+#ifndef FAST_LOCK
54
+static int init_semaphore_set( int size );
55
+#endif
56
+*/
43 57
 
44 58
 #ifdef DBG_LOCK
45
-int _lock( ser_lock_t s , char *file, char *function, unsigned int line );
46
-int _unlock( ser_lock_t s, char *file, char *function, unsigned int line );
47
-#	define lock(_s) _lock( (_s), __FILE__, __FUNCTION__, __LINE__ )
48
-#	define unlock(_s) _unlock( (_s), __FILE__, __FUNCTION__, __LINE__ )
59
+int _lock( ser_lock_t* s , char *file, char *function, unsigned int line );
60
+int _unlock( ser_lock_t* s, char *file, char *function, unsigned int line );
61
+#define lock(_s) _lock( (_s), __FILE__, __FUNCTION__, __LINE__ )
62
+#define unlock(_s) _unlock( (_s), __FILE__, __FUNCTION__, __LINE__ )
49 63
 #else
50
-int _lock( ser_lock_t s );
51
-int _unlock( ser_lock_t s );
52
-#	define lock(_s) _lock( (_s) )
53
-#	define unlock(_s) _unlock( (_s) )
64
+int _lock( ser_lock_t* s );
65
+int _unlock( ser_lock_t* s );
66
+#define lock(_s) _lock( (_s) )
67
+#define unlock(_s) _unlock( (_s) )
54 68
 #endif
55 69
 
70
+/*
71
+#ifndef FAST_LOCK
56 72
 static int change_semaphore( ser_lock_t s  , int val );
73
+#endif
74
+*/
57 75
 
58 76
 int init_cell_lock( struct cell *cell );
59 77
 int init_entry_lock( struct s_table* hash_table, struct entry *entry );
... ...
@@ -51,20 +51,23 @@ inline void set_timer( struct s_table *hash_table,
51 51
 	add_to_tail_of_timer_list( &(hash_table->timers[ list_id ]),
52 52
 		new_tl,get_ticks()+timeout);
53 53
 */
54
-	lock(  list->mutex );
54
+	lock(&(list->mutex));
55 55
 	/* make sure I'm not already on a list */
56 56
 	remove_timer_unsafe( new_tl );
57 57
 	add_timer_unsafe( list, new_tl, get_ticks()+timeout);
58
-	unlock( list->mutex );
58
+	unlock(&(list->mutex));
59 59
 }
60 60
 
61 61
 /* remove from timer list */
62 62
 inline void reset_timer( struct s_table *hash_table,
63 63
 	struct timer_link* tl )
64 64
 {
65
-	lock( timer_group_lock[ tl->tg ] );
65
+	/* lock(&(timer_group_lock[ tl->tg ])); */
66
+	/* hack to work arround this timer group thing*/
67
+	lock(&(hash_table->timers[timer_group[tl->tg]].mutex));
66 68
 	remove_timer_unsafe( tl );
67
-	unlock( timer_group_lock[ tl->tg ] );
69
+	unlock(&(hash_table->timers[timer_group[tl->tg]].mutex));
70
+	/*unlock(&(timer_group_lock[ tl->tg ]));*/
68 71
 }
69 72
 
70 73
 static inline void reset_retr_timers( struct s_table *h_table,
... ...
@@ -76,23 +79,23 @@ static inline void reset_retr_timers( struct s_table *h_table,
76 79
 	DBG("DEBUG:stop_RETR_and_FR_timers : start \n");
77 80
 	/* lock the first timer list of the FR group -- all other
78 81
 	   lists share the same lock*/
79
-	lock(  hash_table->timers[RT_T1_TO_1].mutex );
82
+	lock(&(hash_table->timers[RT_T1_TO_1].mutex));
80 83
 	remove_timer_unsafe( & p_cell->outbound_response.retr_timer );
81 84
 	for( ijk=0 ; ijk<(p_cell)->nr_of_outgoings ; ijk++ )  {
82 85
 			if ( rb = p_cell->outbound_request[ijk] ) {
83 86
 				remove_timer_unsafe( & rb->retr_timer );
84 87
 			}
85 88
 		}
86
-	unlock(  hash_table->timers[RT_T1_TO_1].mutex );
89
+	unlock(&(hash_table->timers[RT_T1_TO_1].mutex));
87 90
 
88
-	lock(  hash_table->timers[FR_TIMER_LIST].mutex );
91
+	lock(&(hash_table->timers[FR_TIMER_LIST].mutex));
89 92
 	remove_timer_unsafe( & p_cell->outbound_response.fr_timer );
90 93
 	for( ijk=0 ; ijk<(p_cell)->nr_of_outgoings ; ijk++ )  {
91 94
 			if ( rb = p_cell->outbound_request[ijk] ) {
92 95
 				remove_timer_unsafe( & rb->fr_timer );
93 96
 			}
94 97
 		}
95
-	unlock(  hash_table->timers[FR_TIMER_LIST].mutex );
98
+	unlock(&(hash_table->timers[FR_TIMER_LIST].mutex));
96 99
 	DBG("DEBUG:stop_RETR_and_FR_timers : stop\n");
97 100
 }
98 101
 
... ...
@@ -33,10 +33,10 @@ extern struct s_table*  hash_table;
33 33
 #include "sip_msg.h"
34 34
 
35 35
 
36
-#define LOCK_REPLIES(_t) lock((_t)->reply_mutex )
37
-#define UNLOCK_REPLIES(_t) unlock((_t)->reply_mutex )
38
-#define LOCK_ACK(_t) lock((_t)->ack_mutex )
39
-#define UNLOCK_ACK(_t) unlock((_t)->ack_mutex )
36
+#define LOCK_REPLIES(_t) lock(&((_t)->reply_mutex) )
37
+#define UNLOCK_REPLIES(_t) unlock(&((_t)->reply_mutex) )
38
+#define LOCK_ACK(_t) lock(&((_t)->ack_mutex) )
39
+#define UNLOCK_ACK(_t) unlock(&((_t)->ack_mutex) )
40 40
 
41 41
 
42 42
 /* convenience short-cut macros */
... ...
@@ -103,10 +103,10 @@ extern struct s_table*  hash_table;
103 103
 #ifdef _OLD_XX
104 104
 #define unref_T(_T_cell) \
105 105
 	( {\
106
-		lock( hash_table->entrys[(_T_cell)->hash_index].mutex );\
106
+		lock( &(hash_table->entrys[(_T_cell)->hash_index].mutex) );\
107 107
 		(_T_cell)->ref_counter--;\
108 108
 		DBG_REF("unref", (_T_cell)); \
109
-		unlock( hash_table->entrys[(_T_cell)->hash_index].mutex );\
109
+		unlock( &(hash_table->entrys[(_T_cell)->hash_index].mutex) );\
110 110
 	} );
111 111
 
112 112
 /* we assume that ref_T is only called from places where
... ...
@@ -101,7 +101,7 @@ int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked )
101 101
 		p_msg->hash_index,isACK);
102 102
 
103 103
 	/* lock the hole entry*/
104
-	lock( hash_table->entrys[p_msg->hash_index].mutex );
104
+	lock(&(hash_table->entrys[p_msg->hash_index].mutex));
105 105
 
106 106
 	/* all the transactions from the entry are compared */
107 107
 	p_cell     = hash_table->entrys[p_msg->hash_index].first_cell;
... ...
@@ -162,7 +162,7 @@ int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked )
162 162
 	/* no transaction found */
163 163
 	T = 0;
164 164
 	if (!leave_new_locked)
165
-		unlock( hash_table->entrys[p_msg->hash_index].mutex );
165
+		unlock(&(hash_table->entrys[p_msg->hash_index].mutex));
166 166
 	DBG("DEBUG: t_lookup_request: no transaction found\n");
167 167
 	return -1;
168 168
 
... ...
@@ -171,7 +171,7 @@ found:
171 171
 	T_REF( T );
172 172
 	DBG("DEBUG:XXXXXXXXXXXXXXXXXXXXX t_lookup_request: "
173 173
 		"transaction found ( T=%p , ref=%x)\n",T,T->ref_bitmap);
174
-	unlock( hash_table->entrys[p_msg->hash_index].mutex );
174
+	unlock(&(hash_table->entrys[p_msg->hash_index].mutex));
175 175
 	return 1;
176 176
 }
177 177
 
... ...
@@ -312,7 +312,7 @@ int t_reply_matching( struct sip_msg *p_msg , unsigned int *p_branch )
312 312
 	   hash_index, entry_label, branch_id );
313 313
 
314 314
 	/* lock the hole entry*/
315
-	lock( hash_table->entrys[hash_index].mutex );
315
+	lock(&(hash_table->entrys[hash_index].mutex));
316 316
 
317 317
 	/*all the cells from the entry are scan to detect an entry_label matching */
318 318
 	p_cell     = hash_table->entrys[hash_index].first_cell;
... ...
@@ -337,7 +337,7 @@ int t_reply_matching( struct sip_msg *p_msg , unsigned int *p_branch )
337 337
 				T = p_cell;
338 338
 				*p_branch = branch_id;
339 339
 				T_REF( T );
340
-				unlock( hash_table->entrys[hash_index].mutex );
340
+				unlock(&(hash_table->entrys[hash_index].mutex));
341 341
 				DBG("DEBUG:XXXXXXXXXXXXXXXXXXXXX t_reply_matching:"
342 342
 				  " reply matched (T=%p,ref=%x)!\n",T,T->ref_bitmap);
343 343
 				return 1;
... ...
@@ -350,7 +350,7 @@ int t_reply_matching( struct sip_msg *p_msg , unsigned int *p_branch )
350 350
 	DBG("DEBUG: t_reply_matching: no matching transaction exists\n");
351 351
 
352 352
 nomatch:
353
-	unlock( hash_table->entrys[hash_index].mutex );
353
+	unlock(&(hash_table->entrys[hash_index].mutex));
354 354
 nomatch2:
355 355
 	DBG("DEBUG: t_reply_matching: failure to match a transaction\n");
356 356
 	*p_branch = -1;
... ...
@@ -485,7 +485,7 @@ enum addifnew_status t_addifnew( struct sip_msg* p_msg )
485 485
 					T_REF(T);
486 486
 				}
487 487
 			}
488
-			unlock( hash_table->entrys[p_msg->hash_index].mutex );
488
+			unlock(&(hash_table->entrys[p_msg->hash_index].mutex));
489 489
 			return ret;
490 490
 		} else {
491 491
 			/* tramsaction found, it's a retransmission  or ACK */
... ...
@@ -63,7 +63,7 @@ void add_timer_unsafe( struct timer *timer_list,
63 63
 {
64 64
 	/*	remove_from_timer_list( tl ); */
65 65
 	/* the entire timer list is locked now -- noone else can manipulate it */
66
-	/* lock( timer_list->mutex ); */
66
+	/* lock( &(timer_list->mutex) ); */
67 67
 	tl->time_out = time_out;
68 68
 	tl->prev_tl = timer_list->last_tl.prev_tl;
69 69
 	tl->next_tl = & timer_list->last_tl;
... ...
@@ -77,7 +77,7 @@ void add_timer_unsafe( struct timer *timer_list,
77 77
 		}
78 78
 #	endif
79 79
 	/* give the list lock away */
80
-	/* unlock( timer_list->mutex ); */
80
+	/* unlock( &(timer_list->mutex) ); */
81 81
 	DBG("DEBUG: add_to_tail_of_timer[%d]: %p\n",timer_list->id,tl);
82 82
 }
83 83
 
... ...
@@ -95,7 +95,7 @@ struct timer_link  *check_and_split_time_list( struct timer *timer_list, int tim
95 95
 			return NULL;
96 96
 
97 97
 	/* the entire timer list is locked now -- noone else can manipulate it */
98
-	lock( timer_list->mutex );
98
+	lock( &(timer_list->mutex) );
99 99
 
100 100
 	end = &timer_list->last_tl;
101 101
 	tl = timer_list->first_tl.next_tl;
... ...
@@ -118,7 +118,7 @@ struct timer_link  *check_and_split_time_list( struct timer *timer_list, int tim
118 118
 	}
119 119
 
120 120
    /* give the list lock away */
121
-   unlock( timer_list->mutex );
121
+   unlock( &(timer_list->mutex) );
122 122
 
123 123
    return ret;
124 124
 }
... ...
@@ -22,7 +22,7 @@ rev_dns=yes      # (cmd. line: -R)
22 22
 #port=5070
23 23
 #listen=127.0.0.1
24 24
 #listen=192.168.57.33
25
-listen=10.0.0.179
25
+#listen=10.0.0.179
26 26
 loop_checks=0
27 27
 # for more info: sip_router -h
28 28