mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-29 02:20:21 +00:00
porting pthread to ARMCC compiler;
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1286 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#include <errno.h>
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "semaphore.h"
|
||||
#include "pthread_internal.h"
|
||||
|
||||
static sem_t* posix_sem_list = RT_NULL;
|
||||
static struct rt_semaphore posix_sem_lock;
|
||||
@@ -60,7 +58,9 @@ static sem_t *posix_sem_find(const char* name)
|
||||
{
|
||||
return iter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return RT_NULL;
|
||||
}
|
||||
|
||||
int sem_close(sem_t *sem)
|
||||
@@ -151,7 +151,6 @@ int sem_getvalue(sem_t *sem, int *sval)
|
||||
|
||||
int sem_init(sem_t *sem, int pshared, unsigned int value)
|
||||
{
|
||||
rt_err_t result;
|
||||
char name[RT_NAME_MAX];
|
||||
static rt_uint16_t psem_number = 0;
|
||||
|
||||
@@ -195,7 +194,7 @@ sem_t *sem_open(const char *name, int oflag, ...)
|
||||
if (oflag & O_CREAT)
|
||||
{
|
||||
va_start(arg, oflag);
|
||||
mode = (mode_t) va_arg( arg, unsigned int);
|
||||
mode = (mode_t) va_arg( arg, unsigned int); mode = mode;
|
||||
value = va_arg( arg, unsigned int);
|
||||
va_end(arg);
|
||||
|
||||
@@ -286,7 +285,7 @@ int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout)
|
||||
if (!sem || !abs_timeout) return EINVAL;
|
||||
|
||||
/* calculate os tick */
|
||||
tick = libc_time_to_tick(abs_timeout);
|
||||
tick = clock_time_to_tick(abs_timeout);
|
||||
|
||||
result = rt_sem_take(sem->sem, tick);
|
||||
if (result == -RT_ETIMEOUT)
|
||||
|
||||
Reference in New Issue
Block a user