Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_loop.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_loop.c	(revision 5023)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_loop.c	(revision 5024)
@@ -223,5 +223,7 @@
     loop->thread_quit_flag = 1;
     /* Unlock transport mutex before joining thread. */
-    pj_lock_release(tp->lock);
+    /// This raised assertion failed "mutex->owner == pj_thread_this()",
+    /// where mutex->owner==NULL
+    //pj_lock_release(tp->lock);
     pj_thread_join(loop->thread);
     pj_thread_destroy(loop->thread);
Index: /pjproject/trunk/pjsip/src/test/regc_test.c
===================================================================
--- /pjproject/trunk/pjsip/src/test/regc_test.c	(revision 5023)
+++ /pjproject/trunk/pjsip/src/test/regc_test.c	(revision 5024)
@@ -371,12 +371,12 @@
 	return -260;
     }
-    if (client_result.interval != client_result.expiration) {
+    if (client_result.have_reg && client_result.interval != client_result.expiration) {
 	PJ_LOG(3,(THIS_FILE, "    error: interval (%d) is different than expiration (%d)",
 		  client_result.interval, client_result.expiration));
 	return -270;
     }
-    if (client_result.expiration > 0 && client_result.next_reg < 1) {
-	PJ_LOG(3,(THIS_FILE, "    error: next_reg=%d, expecting positive number because expiration is %d",
-		  client_result.next_reg, client_result.expiration));
+    if (client_result.interval > 0 && client_result.next_reg < 1) {
+	PJ_LOG(3,(THIS_FILE, "    error: next_reg=%d, expecting positive number because interval is %d",
+		  client_result.next_reg, client_result.interval));
 	return -280;
     }
@@ -403,5 +403,5 @@
     struct client client_cfg = 
 	/* error	code	have_reg    expiration	contact_cnt auth?    destroy*/
-	{ PJ_FALSE,	200,	PJ_TRUE,   TIMEOUT,	1,	    PJ_FALSE,PJ_FALSE};
+	{ PJ_FALSE,	200,	PJ_TRUE,    TIMEOUT,	1,	    PJ_FALSE,PJ_FALSE};
     pj_str_t contact = pj_str("<sip:c@C>");
 
@@ -480,5 +480,5 @@
     struct client client_cfg = 
 	/* error	code	have_reg    expiration	contact_cnt auth?    destroy*/
-	{ PJ_FALSE,	200,	PJ_TRUE,   TIMEOUT,	1,	    PJ_FALSE,PJ_FALSE};
+	{ PJ_FALSE,	200,	PJ_TRUE,    TIMEOUT,	1,	    PJ_FALSE,PJ_FALSE};
     pj_str_t contact = pj_str("<sip:c@C>");
 
@@ -537,5 +537,5 @@
     struct client client_cfg = 
 	/* error	code	have_reg    expiration	contact_cnt auth?    destroy*/
-	{ PJ_FALSE,	200,	PJ_TRUE,   TIMEOUT,	1,	    PJ_FALSE,PJ_FALSE};
+	{ PJ_FALSE,	200,	PJ_TRUE,    TIMEOUT,	1,	    PJ_FALSE,PJ_FALSE};
     pj_str_t contacts[] = {
 	{ "<sip:a>", 7 },
@@ -710,8 +710,8 @@
     struct registrar_cfg server_cfg = 
 	/* respond	code	auth	  contact  exp_prm expires more_contacts */
-	{ PJ_TRUE,	200,	PJ_TRUE,  EXACT,   75,	    0,	    {NULL, 0}};
+	{ PJ_TRUE,	200,	PJ_TRUE,  EXACT,   75,	   0,	    {NULL, 0}};
     struct client client_cfg = 
 	/* error	code	have_reg    expiration	contact_cnt auth?    destroy*/
-	{ PJ_TRUE,	401,	PJ_FALSE, -1,		0,	    PJ_TRUE, PJ_TRUE};
+	{ PJ_TRUE,	401,	PJ_FALSE,   TIMEOUT,	0,	    PJ_TRUE, PJ_TRUE};
     pj_str_t contact = pj_str("<sip:c@C>");
 
@@ -775,5 +775,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	502,	PJ_FALSE,   -1,		0,	    PJ_FALSE}
+	    { PJ_FALSE,	502,	PJ_FALSE,   600,	0,	    PJ_FALSE}
 	},
 
@@ -794,5 +794,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth? */
-	    { PJ_FALSE,	408,	PJ_FALSE,   -1,		0,	    PJ_FALSE}
+	    { PJ_FALSE,	408,	PJ_FALSE,   600,	0,	    PJ_FALSE}
 	},
 
@@ -817,5 +817,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   75,		1,	    PJ_FALSE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    75,		1,	    PJ_FALSE}
 	},
 
@@ -837,5 +837,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   75,		1,	    PJ_TRUE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    75,		1,	    PJ_TRUE}
 	},
 
@@ -855,9 +855,9 @@
 	    /* registrar config: */
 	    /* respond	code	auth	  contact  exp_prm expires more_contacts */
-	    { PJ_TRUE,	200,	PJ_FALSE, EXACT,    75,	    65,	    {"<sip:a@a>;expires=70", 0}},
+	    { PJ_TRUE,	200,	PJ_FALSE, EXACT,   75,	    65,	    {"<sip:a@a>;expires=70", 0}},
 
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   75,		2,	    PJ_FALSE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    75,		2,	    PJ_FALSE}
 	},
 
@@ -884,5 +884,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   75,		1,	    PJ_FALSE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    75,		1,	    PJ_FALSE}
 	},
 
@@ -910,5 +910,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   75,		2,	    PJ_FALSE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    75,		2,	    PJ_FALSE}
 	},
 
@@ -934,5 +934,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	202,	PJ_TRUE,   75,		1,	    PJ_FALSE}
+	    { PJ_FALSE,	202,	PJ_TRUE,    75,		1,	    PJ_FALSE}
 	},
 
@@ -958,5 +958,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   65,		2,	    PJ_FALSE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    65,		2,	    PJ_FALSE}
 	},
 
@@ -980,5 +980,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   65,		0,	    PJ_FALSE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    65,		0,	    PJ_FALSE}
 	},
 
@@ -1001,5 +1001,5 @@
 	    /* client expected results: */
 	    /* error	code	have_reg    expiration	contact_cnt auth?*/
-	    { PJ_FALSE,	200,	PJ_TRUE,   600,		0,	    PJ_FALSE}
+	    { PJ_FALSE,	200,	PJ_TRUE,    600,	0,	    PJ_FALSE}
 	},
     };
