diff options
| author | bernard.xiong <[email protected]> | 2010-03-29 16:05:19 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-03-29 16:05:19 +0000 |
| commit | d088ff636618416245c64ea4f139f0960347b8cd (patch) | |
| tree | 965dbce730d56d2a4652bb3683536c6d918a2730 /examples/kernel | |
| parent | 764393722f2dabca7ecbcfb8454ee8e374016aa6 (diff) | |
add more comments.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@553 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'examples/kernel')
| -rw-r--r-- | examples/kernel/mbox_simple.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/kernel/mbox_simple.c b/examples/kernel/mbox_simple.c index 7e620b87d4..beca23e142 100644 --- a/examples/kernel/mbox_simple.c +++ b/examples/kernel/mbox_simple.c @@ -67,7 +67,11 @@ static void thread2_entry(void* parameter) int mbox_simple_init() { /* 初始化一个mailbox */ - rt_mb_init(&mb, "mbt", &mb_pool[0], 128 / 4, RT_IPC_FLAG_FIFO); + rt_mb_init(&mb, + "mbt", /* 名称是mbt */ + &mb_pool[0], /* 邮箱用到的内存池是mb_pool */ + size(mb_pool)/4, /* 大小是mb_pool大小除以4,因为一封邮件的大小是4字节 */ + RT_IPC_FLAG_FIFO); /* 采用FIFO方式进行线程等待 */ /* 创建线程1 */ tid1 = rt_thread_create("t1", |
