commit
08a8e75ae9
|
@ -17,10 +17,6 @@
|
||||||
#include <dfs_posix.h>
|
#include <dfs_posix.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RT_USING_PTHREADS
|
|
||||||
#include <pthread.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef RT_USING_MODULE
|
#ifdef RT_USING_MODULE
|
||||||
#include <dlmodule.h>
|
#include <dlmodule.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,10 +1,22 @@
|
||||||
from building import *
|
from building import *
|
||||||
|
from utils import VersionCmp
|
||||||
|
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
src = Glob('*.c')
|
src = Glob('*.c')
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
|
CPPDEFINES = []
|
||||||
|
|
||||||
|
# only enable POSIX.1b-1993 Real-time extensions
|
||||||
|
libc_ver = GetDepend('LIBC_VERSION')
|
||||||
|
try:
|
||||||
|
ver = libc_ver.split(' ')
|
||||||
|
ver = ver[1]
|
||||||
|
if VersionCmp(ver, "2.5.0") == 1:
|
||||||
|
CPPDEFINES = ['_POSIX_C_SOURCE=199309L']
|
||||||
|
except :
|
||||||
|
pass
|
||||||
|
|
||||||
group = DefineGroup('pthreads', src,
|
group = DefineGroup('pthreads', src,
|
||||||
depend = ['RT_USING_PTHREADS', 'RT_USING_LIBC'], CPPPATH = CPPPATH)
|
depend = ['RT_USING_PTHREADS', 'RT_USING_LIBC'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -277,7 +277,7 @@ int pthread_create(pthread_t *pid,
|
||||||
|
|
||||||
/* set pthread cleanup function and ptd data */
|
/* set pthread cleanup function and ptd data */
|
||||||
ptd->tid->cleanup = _pthread_cleanup;
|
ptd->tid->cleanup = _pthread_cleanup;
|
||||||
ptd->tid->user_data = (rt_uint32_t)ptd;
|
ptd->tid->user_data = (rt_ubase_t)ptd;
|
||||||
|
|
||||||
/* start thread */
|
/* start thread */
|
||||||
if (rt_thread_startup(ptd->tid) == RT_EOK)
|
if (rt_thread_startup(ptd->tid) == RT_EOK)
|
||||||
|
|
|
@ -623,7 +623,7 @@ struct rt_thread
|
||||||
void *lwp;
|
void *lwp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rt_uint32_t user_data; /**< private user data beyond this thread */
|
rt_ubase_t user_data; /**< private user data beyond this thread */
|
||||||
};
|
};
|
||||||
typedef struct rt_thread *rt_thread_t;
|
typedef struct rt_thread *rt_thread_t;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue