mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-01 03:05:50 +00:00
avoid namespace collision with cepstral.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4502 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
9263ef1f72
commit
354305a132
@ -1 +1 @@
|
|||||||
Mon Feb 19 12:03:56 EST 2007
|
Sat Mar 10 12:59:56 EST 2007
|
@ -5,15 +5,15 @@
|
|||||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
* copies of the Software, and permit persons to whom the Software is
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
* furnished to do so.
|
* furnished to do so.
|
||||||
*
|
*
|
||||||
* This work is provided under this license on an "as is" basis, without warranty of any kind,
|
* This work is provided under this license on an "as is" basis, without warranty of any kind,
|
||||||
* either expressed or implied, including, without limitation, warranties that the covered code
|
* either expressed or implied, including, without limitation, warranties that the covered code
|
||||||
* is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire
|
* is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire
|
||||||
* risk as to the quality and performance of the covered code is with you. Should any covered
|
* risk as to the quality and performance of the covered code is with you. Should any covered
|
||||||
* code prove defective in any respect, you (not the initial developer or any other contributor)
|
* code prove defective in any respect, you (not the initial developer or any other contributor)
|
||||||
* assume the cost of any necessary servicing, repair or correction. This disclaimer of warranty
|
* assume the cost of any necessary servicing, repair or correction. This disclaimer of warranty
|
||||||
* constitutes an essential part of this license. No use of any covered code is authorized hereunder
|
* constitutes an essential part of this license. No use of any covered code is authorized hereunder
|
||||||
* except under this disclaimer.
|
* except under this disclaimer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -38,68 +38,68 @@ struct mutex {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
mutex_status_t mutex_create(mutex_t **mutex)
|
mutex_status_t iax_mutex_create(mutex_t **mutex)
|
||||||
{
|
{
|
||||||
mutex_t *check = NULL;
|
mutex_t *check = NULL;
|
||||||
|
|
||||||
check = (mutex_t *)malloc(sizeof(**mutex));
|
check = (mutex_t *)malloc(sizeof(**mutex));
|
||||||
if (!check)
|
if (!check)
|
||||||
return MUTEX_FAILURE;
|
return MUTEX_FAILURE;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
InitializeCriticalSection(&check->mutex);
|
InitializeCriticalSection(&check->mutex);
|
||||||
#else
|
#else
|
||||||
if (pthread_mutex_init(&check->mutex, NULL))
|
if (pthread_mutex_init(&check->mutex, NULL))
|
||||||
return MUTEX_FAILURE;
|
return MUTEX_FAILURE;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*mutex = check;
|
*mutex = check;
|
||||||
|
|
||||||
return MUTEX_SUCCESS;
|
return MUTEX_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_status_t mutex_destroy(mutex_t *mutex)
|
mutex_status_t iax_mutex_destroy(mutex_t *mutex)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
DeleteCriticalSection(&mutex->mutex);
|
DeleteCriticalSection(&mutex->mutex);
|
||||||
#else
|
#else
|
||||||
if (pthread_mutex_destroy(&mutex->mutex))
|
if (pthread_mutex_destroy(&mutex->mutex))
|
||||||
return MUTEX_FAILURE;
|
return MUTEX_FAILURE;
|
||||||
#endif
|
#endif
|
||||||
free(mutex);
|
free(mutex);
|
||||||
return MUTEX_SUCCESS;
|
return MUTEX_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_status_t mutex_lock(mutex_t *mutex)
|
mutex_status_t iax_mutex_lock(mutex_t *mutex)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
EnterCriticalSection(&mutex->mutex);
|
EnterCriticalSection(&mutex->mutex);
|
||||||
#else
|
#else
|
||||||
if (pthread_mutex_lock(&mutex->mutex))
|
if (pthread_mutex_lock(&mutex->mutex))
|
||||||
return MUTEX_FAILURE;
|
return MUTEX_FAILURE;
|
||||||
#endif
|
#endif
|
||||||
return MUTEX_SUCCESS;
|
return MUTEX_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_status_t mutex_trylock(mutex_t *mutex)
|
mutex_status_t iax_mutex_trylock(mutex_t *mutex)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (!TryEnterCriticalSection(&mutex->mutex))
|
if (!TryEnterCriticalSection(&mutex->mutex))
|
||||||
return MUTEX_FAILURE;
|
return MUTEX_FAILURE;
|
||||||
#else
|
#else
|
||||||
if (pthread_mutex_trylock(&mutex->mutex))
|
if (pthread_mutex_trylock(&mutex->mutex))
|
||||||
return MUTEX_FAILURE;
|
return MUTEX_FAILURE;
|
||||||
#endif
|
#endif
|
||||||
return MUTEX_SUCCESS;
|
return MUTEX_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_status_t mutex_unlock(mutex_t *mutex)
|
mutex_status_t iax_mutex_unlock(mutex_t *mutex)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
LeaveCriticalSection(&mutex->mutex);
|
LeaveCriticalSection(&mutex->mutex);
|
||||||
#else
|
#else
|
||||||
if (pthread_mutex_unlock(&mutex->mutex))
|
if (pthread_mutex_unlock(&mutex->mutex))
|
||||||
return MUTEX_FAILURE;
|
return MUTEX_FAILURE;
|
||||||
#endif
|
#endif
|
||||||
return MUTEX_SUCCESS;
|
return MUTEX_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -5,33 +5,33 @@
|
|||||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
* copies of the Software, and permit persons to whom the Software is
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
* furnished to do so.
|
* furnished to do so.
|
||||||
*
|
*
|
||||||
* This work is provided under this license on an "as is" basis, without warranty of any kind,
|
* This work is provided under this license on an "as is" basis, without warranty of any kind,
|
||||||
* either expressed or implied, including, without limitation, warranties that the covered code
|
* either expressed or implied, including, without limitation, warranties that the covered code
|
||||||
* is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire
|
* is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire
|
||||||
* risk as to the quality and performance of the covered code is with you. Should any covered
|
* risk as to the quality and performance of the covered code is with you. Should any covered
|
||||||
* code prove defective in any respect, you (not the initial developer or any other contributor)
|
* code prove defective in any respect, you (not the initial developer or any other contributor)
|
||||||
* assume the cost of any necessary servicing, repair or correction. This disclaimer of warranty
|
* assume the cost of any necessary servicing, repair or correction. This disclaimer of warranty
|
||||||
* constitutes an essential part of this license. No use of any covered code is authorized hereunder
|
* constitutes an essential part of this license. No use of any covered code is authorized hereunder
|
||||||
* except under this disclaimer.
|
* except under this disclaimer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _SIMPLE_ABSTRACT_MUTEX_H
|
#ifndef _SIMPLE_ABSTRACT_MUTEX_H
|
||||||
#define _SIMPLE_ABSTRACT_MUTEX_H
|
#define _SIMPLE_ABSTRACT_MUTEX_H
|
||||||
|
|
||||||
typedef struct mutex mutex_t;
|
typedef struct mutex mutex_t;
|
||||||
|
|
||||||
typedef enum mutex_status {
|
typedef enum mutex_status {
|
||||||
MUTEX_SUCCESS,
|
MUTEX_SUCCESS,
|
||||||
MUTEX_FAILURE
|
MUTEX_FAILURE
|
||||||
} mutex_status_t;
|
} mutex_status_t;
|
||||||
|
|
||||||
mutex_status_t mutex_create(mutex_t **mutex);
|
mutex_status_t iax_mutex_create(mutex_t **mutex);
|
||||||
mutex_status_t mutex_destroy(mutex_t *mutex);
|
mutex_status_t iax_mutex_destroy(mutex_t *mutex);
|
||||||
mutex_status_t mutex_lock(mutex_t *mutex);
|
mutex_status_t iax_mutex_lock(mutex_t *mutex);
|
||||||
mutex_status_t mutex_trylock(mutex_t *mutex);
|
mutex_status_t iax_mutex_trylock(mutex_t *mutex);
|
||||||
mutex_status_t mutex_unlock(mutex_t *mutex);
|
mutex_status_t iax_mutex_unlock(mutex_t *mutex);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user