Index: extensions/test_app/CMakeLists.txt
===================================================================
--- extensions/test_app/CMakeLists.txt	(revision 120)
+++ extensions/test_app/CMakeLists.txt	(revision 235)
@@ -14,5 +14,4 @@
 	ta_conf.tab.c
 	ta_conf.tab.h
-	ta_sig.c
 	ta_dict.c
 	ta_cli.c
Index: extensions/test_app/ta_cli.c
===================================================================
--- extensions/test_app/ta_cli.c	(revision 203)
+++ extensions/test_app/ta_cli.c	(revision 235)
@@ -136,5 +136,5 @@
 
 /* Create a test message */
-static void ta_cli_test_message(void)
+static void ta_cli_test_message(int sig)
 {
 	struct msg * req = NULL;
@@ -236,5 +236,5 @@
 	CHECK_FCT( fd_sess_handler_create(&ta_cli_reg, free) );
 	
-	CHECK_FCT( ta_sig_init(ta_cli_test_message) );
+	CHECK_FCT( fd_sig_register(ta_conf->signal, "test_app.cli", ta_cli_test_message ) );
 	
 	return 0;
@@ -243,7 +243,7 @@
 void ta_cli_fini(void)
 {
-	ta_sig_fini();
-	
-	(void) fd_sess_handler_destroy(&ta_cli_reg);
+	CHECK_FCT_DO( fd_sig_unregister(ta_conf->signal), /* continue */ );
+	
+	CHECK_FCT_DO( fd_sess_handler_destroy(&ta_cli_reg), /* continue */ );
 	
 	return;
Index: extensions/test_app/ta_sig.c
===================================================================
--- extensions/test_app/ta_sig.c	(revision 120)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/*********************************************************************************************************
-* Software License Agreement (BSD License)                                                               *
-* Author: Sebastien Decugis <sdecugis@nict.go.jp>							 *
-*													 *
-* Copyright (c) 2009, WIDE Project and NICT								 *
-* All rights reserved.											 *
-* 													 *
-* Redistribution and use of this software in source and binary forms, with or without modification, are  *
-* permitted provided that the following conditions are met:						 *
-* 													 *
-* * Redistributions of source code must retain the above 						 *
-*   copyright notice, this list of conditions and the 							 *
-*   following disclaimer.										 *
-*    													 *
-* * Redistributions in binary form must reproduce the above 						 *
-*   copyright notice, this list of conditions and the 							 *
-*   following disclaimer in the documentation and/or other						 *
-*   materials provided with the distribution.								 *
-* 													 *
-* * Neither the name of the WIDE Project or NICT nor the 						 *
-*   names of its contributors may be used to endorse or 						 *
-*   promote products derived from this software without 						 *
-*   specific prior written permission of WIDE Project and 						 *
-*   NICT.												 *
-* 													 *
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
-* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
-* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
-* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 	 *
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 	 *
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
-* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   *
-* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.								 *
-*********************************************************************************************************/
-
-/* Install the signal handler */
-
-#include "test_app.h"
-
-static pthread_t th = (pthread_t) NULL;
-
-static void * ta_sig_th(void * arg)
-{
-	int sig;
-	int ret;
-	sigset_t ss;
-	void (*cb)(void) = arg;
-	
-	fd_log_threadname ( "app_test signal handler" );
-	
-	sigemptyset(&ss);
-	sigaddset(&ss, ta_conf->signal);
-	
-	while (1) {
-		ret = sigwait(&ss, &sig);
-		if (ret != 0) {
-			fd_log_debug("sigwait failed in the app_test extension: %s", strerror(errno));
-			break;
-		}
-		
-		TRACE_DEBUG(FULL, "Signal caught, calling function...");
-		
-		/* Call the cb function */
-		(*cb)();
-		
-	}
-	
-	return NULL;
-}
-
-int ta_sig_init(void (*cb)(void))
-{
-	return pthread_create( &th, NULL, ta_sig_th, (void *)cb );
-}
-
-void ta_sig_fini(void)
-{
-	void * th_ret = NULL;
-	
-	if (th != (pthread_t) NULL) {
-		(void) pthread_cancel(th);
-		(void) pthread_join(th, &th_ret);
-	}
-	
-	return;
-}
Index: extensions/test_app/test_app.c
===================================================================
--- extensions/test_app/test_app.c	(revision 120)
+++ extensions/test_app/test_app.c	(revision 235)
@@ -39,5 +39,4 @@
 
 #include "test_app.h"
-#include <signal.h>
 
 /* Initialize the configuration */
Index: extensions/test_app/test_app.h
===================================================================
--- extensions/test_app/test_app.h	(revision 127)
+++ extensions/test_app/test_app.h	(revision 235)
@@ -42,4 +42,5 @@
  
 #include <freeDiameter/extension.h>
+#include <signal.h>
 
 #ifndef TEST_APP_DEFAULT_SIGNAL
@@ -69,8 +70,4 @@
 int ta_conf_handle(char * conffile);
 
-/* Start or stop the signal handler */
-int ta_sig_init(void (*cb)(void));
-void ta_sig_fini(void);
-
 /* Handle incoming messages (server) */
 int ta_serv_init(void);
