|
@@ -98,9 +98,9 @@ void consumer_thread_entry(void* parameter)
|
|
int semaphore_producer_consumer_init()
|
|
int semaphore_producer_consumer_init()
|
|
{
|
|
{
|
|
/* 初始化3个信号量 */
|
|
/* 初始化3个信号量 */
|
|
- rt_sem_init(&sem_lock , "lock", 1, RT_IPC_FLAG_FIFO);
|
|
|
|
- rt_sem_init(&sem_empty, "empty", MAXSEM, RT_IPC_FLAG_FIFO);
|
|
|
|
- rt_sem_init(&sem_full , "full", 0, RT_IPC_FLAG_FIFO);
|
|
|
|
|
|
+ rt_sem_init(&sem_lock , "lock", 1, RT_IPC_FLAG_PRIO);
|
|
|
|
+ rt_sem_init(&sem_empty, "empty", MAXSEM, RT_IPC_FLAG_PRIO);
|
|
|
|
+ rt_sem_init(&sem_full , "full", 0, RT_IPC_FLAG_PRIO);
|
|
|
|
|
|
/* 创建线程1 */
|
|
/* 创建线程1 */
|
|
producer_tid = rt_thread_create("producer",
|
|
producer_tid = rt_thread_create("producer",
|