add semaphore max value control. (#8390)

This commit is contained in:
geniusgogo
2023-12-21 10:31:27 +08:00
committed by GitHub
parent 0541b39d61
commit 3dfafcd1d9
2 changed files with 54 additions and 20 deletions

View File

@@ -1038,6 +1038,7 @@ typedef struct rt_thread *rt_thread_t;
#define RT_IPC_CMD_UNKNOWN 0x00 /**< unknown IPC command */
#define RT_IPC_CMD_RESET 0x01 /**< reset IPC object */
#define RT_IPC_CMD_GET_STATE 0x02 /**< get the state of IPC object */
#define RT_IPC_CMD_SET_VLIMIT 0x03 /**< set max limit value of IPC value */
#define RT_WAITING_FOREVER -1 /**< Block forever until get resource. */
#define RT_WAITING_NO 0 /**< Non-block. */
@@ -1061,7 +1062,7 @@ struct rt_semaphore
struct rt_ipc_object parent; /**< inherit from ipc_object */
rt_uint16_t value; /**< value of semaphore. */
rt_uint16_t reserved; /**< reserved field */
rt_uint16_t max_value;
struct rt_spinlock spinlock;
};
typedef struct rt_semaphore *rt_sem_t;