summaryrefslogtreecommitdiff
path: root/components/pthreads/pthread_internal.h
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-11-24 23:59:27 +0000
committer[email protected] <[email protected]>2010-11-24 23:59:27 +0000
commit7191e2220fe1dc6e7ae4ff0af657bfe25b43379f (patch)
treed3f066721f6e5b6b9672a82da4c361a961bbcc93 /components/pthreads/pthread_internal.h
parentf5d2b36adb96c7fc2b8984ef7c9c34ec23edb497 (diff)
add pthread magic assert.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1112 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/pthreads/pthread_internal.h')
-rw-r--r--components/pthreads/pthread_internal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/components/pthreads/pthread_internal.h b/components/pthreads/pthread_internal.h
index 5d00d15091..d9550fe50f 100644
--- a/components/pthreads/pthread_internal.h
+++ b/components/pthreads/pthread_internal.h
@@ -48,9 +48,14 @@ typedef struct _pthread_data _pthread_data_t;
rt_inline _pthread_data_t* _pthread_get_data(pthread_t thread)
{
+ _pthread_data_t* ptd;
RT_ASSERT(thread != RT_NULL);
- return (_pthread_data_t*)thread->user_data;
+ ptd = (_pthread_data_t*)thread->user_data;
+ RT_ASSERT(ptd != RT_NULL);
+ RT_ASSERT(ptd->magic == PTHREAD_MAGIC);
+
+ return ptd;
}
extern int libc_time_to_tick(const struct timespec *time);