[Freeswitch-svn] [commit] r8105 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket

Freeswitch SVN anthm at freeswitch.org
Mon Apr 14 12:18:49 EDT 2008


Author: anthm
Date: Mon Apr 14 12:18:49 2008
New Revision: 8105

Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c

Log:
avoid little race

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Mon Apr 14 12:18:49 2008
@@ -852,10 +852,11 @@
 			acs->arg = switch_core_strdup(acs->pool, arg);
 		}
 		acs->bg = 1;
+
 		switch_threadattr_create(&thd_attr, acs->pool);
 		switch_threadattr_detach_set(thd_attr, 1);
 		switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
-		switch_thread_create(&thread, thd_attr, api_exec, acs, acs->pool);
+
 		if ((uuid_str = switch_event_get_header(event, "job-uuid"))) {
 			switch_copy_string(acs->uuid_str, uuid_str, sizeof(acs->uuid_str));
 		} else {
@@ -863,6 +864,8 @@
 			switch_uuid_format(acs->uuid_str, &uuid);
 		}
 		switch_snprintf(reply, reply_len, "+OK Job-UUID: %s", acs->uuid_str);
+
+		switch_thread_create(&thread, thd_attr, api_exec, acs, acs->pool);
 		
 		return SWITCH_STATUS_SUCCESS;
 	} else if (!strncasecmp(cmd, "log", 3)) {



More information about the Freeswitch-svn mailing list