summaryrefslogtreecommitdiff
path: root/main/bridge_channel.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2015-01-26 14:50:40 +0000
committerDavid M. Lee <dlee@digium.com>2015-01-26 14:50:40 +0000
commit965777ccfc61067d1dc79f79c12d52f794fa3983 (patch)
treefc931f38e9acc6885ca0df5fdbc1e14bac437495 /main/bridge_channel.c
parenta8ae5a7bcb3c102b1a196d109a1d06507dd3dd1e (diff)
Various fixes for OS X
This patch addresses compilation errors on OS X. It's been a while, so there's quite a few things. * Fixed __attribute__ decls in route.h to be portable. * Fixed htonll and ntohll to work when they are defined as macros. * Replaced sem_t usage with our ast_sem wrapper. * Added ast_sem_timedwait to our ast_sem wrapper. * Fixed some GCC 4.9 warnings using sig*set() functions. * Fixed some format strings for portability. * Fixed compilation issues with res_timing_kqueue (although tests still fail on OS X). * Fixed menuconfig /sbin/launchd detection, which disables res_timing_kqueue on OS X). ASTERISK-24539 #close Reported by: George Joseph ASTERISK-24544 #close Reported by: George Joseph Review: https://reviewboard.asterisk.org/r/4327/ ........ Merged revisions 431092 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/bridge_channel.c')
-rw-r--r--main/bridge_channel.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index ff72c57bb..25a1a5153 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -35,7 +35,6 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <signal.h>
-#include <semaphore.h>
#include "asterisk/heap.h"
#include "asterisk/astobj2.h"
@@ -56,6 +55,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/parking.h"
#include "asterisk/causes.h"
#include "asterisk/test.h"
+#include "asterisk/sem.h"
/*!
* \brief Used to queue an action frame onto a bridge channel and write an action frame into a bridge.
@@ -101,7 +101,7 @@ struct bridge_sync {
/*! Unique ID of this synchronization object. Corresponds with ID in synchronous frame payload */
unsigned int id;
/*! Semaphore used for synchronization */
- sem_t sem;
+ struct ast_sem sem;
/*! Pointer to next entry in the list */
AST_LIST_ENTRY(bridge_sync) list;
};
@@ -124,7 +124,7 @@ static void bridge_sync_init(struct bridge_sync *sync_struct, unsigned int id)
{
memset(sync_struct, 0, sizeof(*sync_struct));
sync_struct->id = id;
- sem_init(&sync_struct->sem, 0, 0);
+ ast_sem_init(&sync_struct->sem, 0, 0);
AST_RWLIST_WRLOCK(&sync_structs);
AST_RWLIST_INSERT_TAIL(&sync_structs, sync_struct, list);
@@ -157,7 +157,7 @@ static void bridge_sync_cleanup(struct bridge_sync *sync_struct)
AST_LIST_TRAVERSE_SAFE_END;
AST_RWLIST_UNLOCK(&sync_structs);
- sem_destroy(&sync_struct->sem);
+ ast_sem_destroy(&sync_struct->sem);
}
/*!
@@ -189,7 +189,7 @@ static void bridge_sync_wait(struct bridge_sync *sync_struct)
.tv_nsec = timeout_val.tv_usec * 1000,
};
- sem_timedwait(&sync_struct->sem, &timeout_spec);
+ ast_sem_timedwait(&sync_struct->sem, &timeout_spec);
}
/*!
@@ -204,7 +204,7 @@ static void bridge_sync_wait(struct bridge_sync *sync_struct)
*/
static void bridge_sync_signal(struct bridge_sync *sync_struct)
{
- sem_post(&sync_struct->sem);
+ ast_sem_post(&sync_struct->sem);
}
void ast_bridge_channel_lock_bridge(struct ast_bridge_channel *bridge_channel)