Changeset 1266 for pjproject/trunk/pjlib/src/pj/os_core_unix.c
- Timestamp:
- May 11, 2007 3:14:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r1076 r1266 22 22 * the RTEMS port. 23 23 */ 24 #define _GNU_SOURCE 24 #ifndef _GNU_SOURCE 25 # define _GNU_SOURCE 26 #endif 25 27 #include <pj/os.h> 26 28 #include <pj/assert.h> … … 340 342 static void *thread_main(void *param) 341 343 { 342 pj_thread_t *rec = param;344 pj_thread_t *rec = (pj_thread_t*)param; 343 345 void *result; 344 346 pj_status_t rc; … … 507 509 { 508 510 #if PJ_HAS_THREADS 509 pj_thread_t *rec = pj_thread_local_get(thread_tls_id);511 pj_thread_t *rec = (pj_thread_t*)pj_thread_local_get(thread_tls_id); 510 512 511 513 if (rec == NULL) { … … 664 666 { 665 667 pj_status_t rc; 666 pj_atomic_t *atomic_var = pj_pool_calloc(pool, 1, sizeof(pj_atomic_t)); 668 pj_atomic_t *atomic_var; 669 670 atomic_var = PJ_POOL_ZALLOC_T(pool, pj_atomic_t); 671 667 672 PJ_ASSERT_RETURN(atomic_var, PJ_ENOMEM); 668 673 … … 908 913 909 914 /////////////////////////////////////////////////////////////////////////////// 915 #if defined(PJ_LINUX) && PJ_LINUX!=0 916 PJ_BEGIN_DECL 917 PJ_DECL(int) pthread_mutexattr_settype(pthread_mutexattr_t*,int); 918 PJ_END_DECL 919 #endif 920 910 921 static pj_status_t init_mutex(pj_mutex_t *mutex, const char *name, int type) 911 922 { … … 922 933 if (type == PJ_MUTEX_SIMPLE) { 923 934 #if defined(PJ_LINUX) && PJ_LINUX!=0 924 extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int);925 935 rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP); 926 936 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 … … 931 941 } else { 932 942 #if defined(PJ_LINUX) && PJ_LINUX!=0 933 extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int);934 943 rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); 935 944 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 … … 992 1001 PJ_ASSERT_RETURN(pool && ptr_mutex, PJ_EINVAL); 993 1002 994 mutex = pj_pool_alloc(pool, sizeof(*mutex));1003 mutex = PJ_POOL_ALLOC_T(pool, pj_mutex_t); 995 1004 PJ_ASSERT_RETURN(mutex, PJ_ENOMEM); 996 1005 … … 1229 1238 PJ_UNUSED_ARG(name); 1230 1239 1231 rwm = pj_pool_alloc(pool, sizeof(pj_rwmutex_t));1240 rwm = PJ_POOL_ALLOC_T(pool, pj_rwmutex_t); 1232 1241 PJ_ASSERT_RETURN(rwm, PJ_ENOMEM); 1233 1242 … … 1330 1339 PJ_ASSERT_RETURN(pool != NULL && ptr_sem != NULL, PJ_EINVAL); 1331 1340 1332 sem = pj_pool_alloc(pool, sizeof(*sem));1341 sem = PJ_POOL_ALLOC_T(pool, pj_sem_t); 1333 1342 PJ_ASSERT_RETURN(sem, PJ_ENOMEM); 1334 1343
Note: See TracChangeset
for help on using the changeset viewer.