[asterisk-commits] rmudgett: trunk r382294 - in /trunk: include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 28 15:30:00 CST 2013


Author: rmudgett
Date: Thu Feb 28 15:29:57 2013
New Revision: 382294

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382294
Log:
threadpool: Whitespace and comment corrections.

Modified:
    trunk/include/asterisk/threadpool.h
    trunk/main/threadpool.c

Modified: trunk/include/asterisk/threadpool.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/threadpool.h?view=diff&rev=382294&r1=382293&r2=382294
==============================================================================
--- trunk/include/asterisk/threadpool.h (original)
+++ trunk/include/asterisk/threadpool.h Thu Feb 28 15:29:57 2013
@@ -103,6 +103,9 @@
 	 *
 	 * When the threadpool's size increases, it can never increase
 	 * beyond this number of threads.
+	 *
+	 * Zero is a valid value if the threadpool does not have a
+	 * maximum size.
 	 */
 	int max_size;
 };
@@ -132,7 +135,7 @@
  * \brief Create a new threadpool
  *
  * This function creates a threadpool. Tasks may be pushed onto this thread pool
- * in and will be automatically acted upon by threads within the pool.
+ * and will be automatically acted upon by threads within the pool.
  *
  * Only a single threadpool with a given name may exist. This function will fail
  * if a threadpool with the given name already exists.

Modified: trunk/main/threadpool.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/threadpool.c?view=diff&rev=382294&r1=382293&r2=382294
==============================================================================
--- trunk/main/threadpool.c (original)
+++ trunk/main/threadpool.c Thu Feb 28 15:29:57 2013
@@ -94,7 +94,7 @@
 	 * that the threadpool had its state change.
 	 */
 	struct ast_taskprocessor *control_tps;
-	/*! True if the threadpool is in the processof shutting down */
+	/*! True if the threadpool is in the process of shutting down */
 	int shutting_down;
 	/*! Threadpool-specific options */
 	struct ast_threadpool_options options;
@@ -1127,28 +1127,30 @@
 
 static int execute_tasks(void *data)
 {
-       struct ast_taskprocessor *tps = data;
-
-       while (ast_taskprocessor_execute(tps)) {
-	       /* No-op */
-       }
-
-       ast_taskprocessor_unreference(tps);
-       return 0;
-}
-
-static void serializer_task_pushed(struct ast_taskprocessor_listener *listener, int was_empty) {
-       if (was_empty) {
-	       struct serializer *ser = ast_taskprocessor_listener_get_user_data(listener);
-	       struct ast_taskprocessor *tps = ast_taskprocessor_listener_get_tps(listener);
-	       ast_threadpool_push(ser->pool, execute_tasks, tps);
-       }
-};
+	struct ast_taskprocessor *tps = data;
+
+	while (ast_taskprocessor_execute(tps)) {
+		/* No-op */
+	}
+
+	ast_taskprocessor_unreference(tps);
+	return 0;
+}
+
+static void serializer_task_pushed(struct ast_taskprocessor_listener *listener, int was_empty)
+{
+	if (was_empty) {
+		struct serializer *ser = ast_taskprocessor_listener_get_user_data(listener);
+		struct ast_taskprocessor *tps = ast_taskprocessor_listener_get_tps(listener);
+
+		ast_threadpool_push(ser->pool, execute_tasks, tps);
+	}
+}
 
 static int serializer_start(struct ast_taskprocessor_listener *listener)
 {
-       /* No-op */
-       return 0;
+	/* No-op */
+	return 0;
 }
 
 static void serializer_shutdown(struct ast_taskprocessor_listener *listener)
@@ -1158,9 +1160,9 @@
 }
 
 static struct ast_taskprocessor_listener_callbacks serializer_tps_listener_callbacks = {
-       .task_pushed = serializer_task_pushed,
-       .start = serializer_start,
-       .shutdown = serializer_shutdown,
+	.task_pushed = serializer_task_pushed,
+	.start = serializer_start,
+	.shutdown = serializer_shutdown,
 };
 
 struct ast_taskprocessor *ast_threadpool_serializer(const char *name, struct ast_threadpool *pool)




More information about the asterisk-commits mailing list