[asterisk-commits] dhubbard: branch dhubbard/named_processors r107009 - in /team/dhubbard/named_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Mar 8 21:48:39 CST 2008


Author: dhubbard
Date: Sat Mar  8 21:48:39 2008
New Revision: 107009

URL: http://svn.digium.com/view/asterisk?view=rev&rev=107009
Log:
stuff

Modified:
    team/dhubbard/named_processors/res/res_testobserver.c
    team/dhubbard/named_processors/res/sandbox/include/task.h
    team/dhubbard/named_processors/res/sandbox/include/taskprocessor.h
    team/dhubbard/named_processors/res/sandbox/simobject.c
    team/dhubbard/named_processors/res/sandbox/taskprocessor.c

Modified: team/dhubbard/named_processors/res/res_testobserver.c
URL: http://svn.digium.com/view/asterisk/team/dhubbard/named_processors/res/res_testobserver.c?view=diff&rev=107009&r1=107008&r2=107009
==============================================================================
--- team/dhubbard/named_processors/res/res_testobserver.c (original)
+++ team/dhubbard/named_processors/res/res_testobserver.c Sat Mar  8 21:48:39 2008
@@ -64,7 +64,7 @@
 static const char config[] = "testobserver.conf";
   
 #define MAX_TEST_PROCESSORS 4
-#define MAX_TEST_PRODUCERS  20
+#define MAX_TEST_PRODUCERS  0
 struct simobject* simprod[MAX_TEST_PRODUCERS];
 
 AST_MUTEX_DEFINE_STATIC(_global_killflag_lock);
@@ -254,7 +254,7 @@
 		snprintf(tbuf, sizeof(tbuf), "sillyprocessor-%d", count);
 		ast_log(LOG_DEBUG, "%s\n", tbuf);
 		if (!exists_taskprocessor_singleton(tbuf)) {
-			if (construct_taskprocessor_singleton(tbuf, _evtq_poll_thread_function) < 0) {
+			if (create_taskprocessor_singleton(tbuf, _evtq_poll_thread_function) < 0) {
 				ast_log(LOG_ERROR, "can't create \'%s\' taskprocessor singleton\n", tbuf);
 				return AST_MODULE_LOAD_DECLINE;
 			}

Modified: team/dhubbard/named_processors/res/sandbox/include/task.h
URL: http://svn.digium.com/view/asterisk/team/dhubbard/named_processors/res/sandbox/include/task.h?view=diff&rev=107009&r1=107008&r2=107009
==============================================================================
--- team/dhubbard/named_processors/res/sandbox/include/task.h (original)
+++ team/dhubbard/named_processors/res/sandbox/include/task.h Sat Mar  8 21:48:39 2008
@@ -26,14 +26,7 @@
 #ifndef __task_h__
 #define __task_h__
 
-typedef enum {
-	TASK_COMMAND = 0
-	, TASK_EVENT
-	, TASK_NOTIFICATION
-} enum_task_class;
-
 struct a_task {
-	enum_task_class _type;
 	unsigned long _id;
 	char _source[256];
 	void* _p_producer;

Modified: team/dhubbard/named_processors/res/sandbox/include/taskprocessor.h
URL: http://svn.digium.com/view/asterisk/team/dhubbard/named_processors/res/sandbox/include/taskprocessor.h?view=diff&rev=107009&r1=107008&r2=107009
==============================================================================
--- team/dhubbard/named_processors/res/sandbox/include/taskprocessor.h (original)
+++ team/dhubbard/named_processors/res/sandbox/include/taskprocessor.h Sat Mar  8 21:48:39 2008
@@ -50,10 +50,10 @@
 
 unsigned char _evtq_poll_thread_run;
 
-int construct_taskprocessor_singleton(const char* name, void* (*func)(void*));
+int create_taskprocessor_singleton(const char* name, void* (*func)(void*));
 int start_taskprocessor_singleton(const char* name);
 int stop_taskprocessor_singleton(const char* name);
-int destruct_taskprocessor_singleton(struct taskprocessor_singleton_info* t);
+int destroy_taskprocessor_singleton(struct taskprocessor_singleton_info* t);
 int size_of_taskprocessor_singleton_list(void);
 struct taskprocessor_singleton_info* get_taskprocessor_singleton(const char* name);
 int exists_taskprocessor_singleton(char *name);

Modified: team/dhubbard/named_processors/res/sandbox/simobject.c
URL: http://svn.digium.com/view/asterisk/team/dhubbard/named_processors/res/sandbox/simobject.c?view=diff&rev=107009&r1=107008&r2=107009
==============================================================================
--- team/dhubbard/named_processors/res/sandbox/simobject.c (original)
+++ team/dhubbard/named_processors/res/sandbox/simobject.c Sat Mar  8 21:48:39 2008
@@ -73,7 +73,7 @@
 	s->_producer = construct_taskproducer(s, t);
 	s->_consumer = construct_taskconsumer(s, t);
 	if (!exists_taskprocessor_singleton(tpg)) {
-		if (construct_taskprocessor_singleton(tpg, _simproducer_thread_function) < 0) {
+		if (create_taskprocessor_singleton(tpg, _simproducer_thread_function) < 0) {
 			ast_log(LOG_ERROR, "can't create \'%s\' taskprocessor singleton\n", tpg);
 			free(s);
 			return NULL;
@@ -245,7 +245,8 @@
 		 *
 		 * start by sleeping for the poll frequency, then produce a task 
 		 */
-		usleep((rand()%10)+freq);
+		//usleep((rand()%10)+freq);
+		usleep(1000);
 		if (!s) {
 			ast_log(LOG_ERROR, "Huh? we have no private simobject pointer?  This is bad!\n");
 			break;

Modified: team/dhubbard/named_processors/res/sandbox/taskprocessor.c
URL: http://svn.digium.com/view/asterisk/team/dhubbard/named_processors/res/sandbox/taskprocessor.c?view=diff&rev=107009&r1=107008&r2=107009
==============================================================================
--- team/dhubbard/named_processors/res/sandbox/taskprocessor.c (original)
+++ team/dhubbard/named_processors/res/sandbox/taskprocessor.c Sat Mar  8 21:48:39 2008
@@ -194,7 +194,7 @@
 	return t;
 }
 	
-int construct_taskprocessor_singleton(const char* name, void* (*func)(void*))
+int create_taskprocessor_singleton(const char* name, void* (*func)(void*))
 {
 	int index;
 	struct taskprocessor_singleton_info* p = NULL;
@@ -265,7 +265,7 @@
 	pthread_join(p->_poll_thread, NULL);
 	p->_poll_thread = AST_PTHREADT_NULL;
 	ast_log(LOG_DEBUG, "taskprocessor \'%s\' stopped.\n", name);
-	return destruct_taskprocessor_singleton(p);
+	return destroy_taskprocessor_singleton(p);
 }
 	
 int wait_for_all_taskprocessors_to_stop(void)
@@ -293,7 +293,7 @@
 	return 0;
 }
 
-int destruct_taskprocessor_singleton(struct taskprocessor_singleton_info* t)
+int destroy_taskprocessor_singleton(struct taskprocessor_singleton_info* t)
 {
 	if (!t) {
 		ast_log(LOG_ERROR, "can't destruct a NULL taskprocessor_singleton.\n");




More information about the asterisk-commits mailing list