aboutsummaryrefslogtreecommitdiffstats
path: root/sched.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-22 17:42:14 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-22 17:42:14 +0000
commitae5c80e1deeae11fa0f3478a6efa03e38971897f (patch)
treea3a0875ae4e73c9d9a1fc67f56ffa1ce73fe5457 /sched.c
parent8f813d432c685f0b0c25e98261379b083263cf32 (diff)
Merge major BSD mutex and symbol conflict patches (bug #1816) (link patch still pending)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3273 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'sched.c')
-rwxr-xr-xsched.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sched.c b/sched.c
index b8c494015..48417ef71 100755
--- a/sched.c
+++ b/sched.c
@@ -22,6 +22,7 @@
#include <sys/time.h>
#include <unistd.h>
#include <pthread.h>
+#include <string.h>
#include <asterisk/sched.h>
#include <asterisk/logger.h>
@@ -63,6 +64,7 @@ struct sched_context *sched_context_create(void)
struct sched_context *tmp;
tmp = malloc(sizeof(struct sched_context));
if (tmp) {
+ memset(tmp, 0, sizeof(struct sched_context));
ast_mutex_init(&tmp->lock);
tmp->eventcnt = 1;
tmp->schedcnt = 0;
@@ -97,6 +99,7 @@ void sched_context_destroy(struct sched_context *con)
}
/* And the context */
ast_mutex_unlock(&con->lock);
+ ast_mutex_destroy(&con->lock);
free(con);
}