diff options
| author | Meco Jianting Man <[email protected]> | 2021-02-27 01:02:48 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-27 01:02:48 -0600 |
| commit | 8932ffdb96b793031bbc71bb3bd23202939fcb2c (patch) | |
| tree | 33ac8cd4afac62c449384ed20f2af94ab0b90708 /src | |
| parent | bc28df8b350f2118f418b966df0843c7f2c02496 (diff) | |
| parent | 2bf53d315d62bd199c01fd2d6a7f05d1a6712153 (diff) | |
Merge pull request #21 from RT-Thread/master
pr
Diffstat (limited to 'src')
| -rw-r--r-- | src/kservice.c | 22 | ||||
| -rw-r--r-- | src/thread.c | 15 | ||||
| -rw-r--r-- | src/timer.c | 2 |
3 files changed, 3 insertions, 36 deletions
diff --git a/src/kservice.c b/src/kservice.c index 423fe3ddb3..9fc3971c7e 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -1386,26 +1386,4 @@ void rt_assert_handler(const char *ex_string, const char *func, rt_size_t line) RTM_EXPORT(rt_assert_handler); #endif /* RT_DEBUG */ -#if !defined (RT_USING_NEWLIB) && defined (RT_USING_MINILIBC) && defined (__GNUC__) -#include <sys/types.h> -void *memcpy(void *dest, const void *src, size_t n) __attribute__((weak, alias("rt_memcpy"))); -void *memset(void *s, int c, size_t n) __attribute__((weak, alias("rt_memset"))); -void *memmove(void *dest, const void *src, size_t n) __attribute__((weak, alias("rt_memmove"))); -int memcmp(const void *s1, const void *s2, size_t n) __attribute__((weak, alias("rt_memcmp"))); - -size_t strlen(const char *s) __attribute__((weak, alias("rt_strlen"))); -char *strstr(const char *s1, const char *s2) __attribute__((weak, alias("rt_strstr"))); -int strcasecmp(const char *a, const char *b) __attribute__((weak, alias("rt_strcasecmp"))); -char *strncpy(char *dest, const char *src, size_t n) __attribute__((weak, alias("rt_strncpy"))); -int strncmp(const char *cs, const char *ct, size_t count) __attribute__((weak, alias("rt_strncmp"))); -#ifdef RT_USING_HEAP -char *strdup(const char *s) __attribute__((weak, alias("rt_strdup"))); -#endif - -int sprintf(char *buf, const char *format, ...) __attribute__((weak, alias("rt_sprintf"))); -int snprintf(char *buf, rt_size_t size, const char *fmt, ...) __attribute__((weak, alias("rt_snprintf"))); -int vsprintf(char *buf, const char *format, va_list arg_ptr) __attribute__((weak, alias("rt_vsprintf"))); - -#endif - /**@}*/ diff --git a/src/thread.c b/src/thread.c index 2681eca59f..18b5227f5a 100644 --- a/src/thread.c +++ b/src/thread.c @@ -382,19 +382,8 @@ rt_err_t rt_thread_detach(rt_thread_t thread) /* change stat */ thread->stat = RT_THREAD_CLOSE; - if (rt_object_is_systemobject((rt_object_t)thread) == RT_TRUE) - { - rt_object_detach((rt_object_t)thread); - } - else - { - /* disable interrupt */ - lock = rt_hw_interrupt_disable(); - /* insert to defunct thread list */ - rt_list_insert_after(&rt_thread_defunct, &(thread->tlist)); - /* enable interrupt */ - rt_hw_interrupt_enable(lock); - } + /* detach thread object */ + rt_object_detach((rt_object_t)thread); return RT_EOK; } diff --git a/src/timer.c b/src/timer.c index d882711151..747c28c8bd 100644 --- a/src/timer.c +++ b/src/timer.c @@ -233,7 +233,7 @@ rt_err_t rt_timer_detach(rt_timer_t timer) /* enable interrupt */ rt_hw_interrupt_enable(level); - rt_object_detach((rt_object_t)timer); + rt_object_detach(&(timer->parent)); return RT_EOK; } |
