diff options
author | Mark Michelson <mmichelson@digium.com> | 2012-12-13 16:39:40 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2012-12-13 16:39:40 +0000 |
commit | ece4c957988c3926f679f805294072c31de59bda (patch) | |
tree | 18addab5cab2b5c8c7b1f120bf78c7114735ea63 /main | |
parent | 7b5f4748fb368d81d588ae61a54d7a37c2f906ee (diff) |
Resolve conflict and reset automerge.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/taskprocessor.c | 7 | ||||
-rw-r--r-- | main/utils.c | 10 |
2 files changed, 8 insertions, 9 deletions
diff --git a/main/taskprocessor.c b/main/taskprocessor.c index a1e54a3b4..3ba544292 100644 --- a/main/taskprocessor.c +++ b/main/taskprocessor.c @@ -224,10 +224,15 @@ static const struct ast_taskprocessor_listener_callbacks default_listener_callba .destroy = default_listener_destroy, }; -/*! \internal \brief Clean up resources on Asterisk shutdown */ +/*! + * \internal + * \brief Clean up resources on Asterisk shutdown + */ static void tps_shutdown(void) { + ast_cli_unregister_multiple(taskprocessor_clis, ARRAY_LEN(taskprocessor_clis)); ao2_t_ref(tps_singletons, -1, "Unref tps_singletons in shutdown"); + tps_singletons = NULL; } /* initialize the taskprocessor container and register CLI operations */ diff --git a/main/utils.c b/main/utils.c index 24a8326a8..cdb9b1a44 100644 --- a/main/utils.c +++ b/main/utils.c @@ -35,9 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <sys/stat.h> #include <sys/stat.h> -#ifdef HAVE_DEV_URANDOM #include <fcntl.h> -#endif #include <sys/syscall.h> #if defined(__APPLE__) @@ -496,9 +494,7 @@ const char *ast_inet_ntoa(struct in_addr ia) return inet_ntop(AF_INET, &ia, buf, INET_ADDRSTRLEN); } -#ifdef HAVE_DEV_URANDOM static int dev_urandom_fd; -#endif #ifndef __linux__ #undef pthread_create /* For ast_pthread_create function only */ @@ -1494,7 +1490,7 @@ AST_MUTEX_DEFINE_STATIC(randomlock); long int ast_random(void) { long int res; -#ifdef HAVE_DEV_URANDOM + if (dev_urandom_fd >= 0) { int read_res = read(dev_urandom_fd, &res, sizeof(res)); if (read_res > 0) { @@ -1504,7 +1500,7 @@ long int ast_random(void) return res % rm; } } -#endif + /* XXX - Thread safety really depends on the libc, not the OS. * * But... popular Linux libc's (uClibc, glibc, eglibc), all have a @@ -2035,9 +2031,7 @@ int ast_mkdir(const char *path, int mode) int ast_utils_init(void) { -#ifdef HAVE_DEV_URANDOM dev_urandom_fd = open("/dev/urandom", O_RDONLY); -#endif base64_init(); #ifdef DEBUG_THREADS #if !defined(LOW_MEMORY) |