diff options
| author | Meco Man <[email protected]> | 2021-11-17 15:57:15 -0500 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-11-17 15:57:15 -0500 |
| commit | df9a23c534f57e6f5b06acfbe6db8b636894e0ad (patch) | |
| tree | a59dee4012835d6a8d1d1b4566b4a49a719798bd /components | |
| parent | fbca0c7f7d195eb8901902c4f94f4bab4395db61 (diff) | |
[mutex] use RT_IPC_FLAG_PRIO to replace RT_IPC_FLAG_FIFO
Diffstat (limited to 'components')
22 files changed, 26 insertions, 26 deletions
diff --git a/components/cplusplus/cxx_Mutex.cpp b/components/cplusplus/cxx_Mutex.cpp index 97d8fa87e1..da6f80985f 100644 --- a/components/cplusplus/cxx_Mutex.cpp +++ b/components/cplusplus/cxx_Mutex.cpp @@ -13,7 +13,7 @@ using namespace rtthread; Mutex::Mutex(const char *name) { - rt_mutex_init(&mID, name, RT_IPC_FLAG_FIFO); + rt_mutex_init(&mID, name, RT_IPC_FLAG_PRIO); } bool Mutex::lock(int32_t millisec) diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c index 01d303f71f..166c9d77da 100644 --- a/components/dfs/filesystems/elmfat/dfs_elm.c +++ b/components/dfs/filesystems/elmfat/dfs_elm.c @@ -980,7 +980,7 @@ int ff_cre_syncobj(BYTE drv, FF_SYNC_t *m) rt_mutex_t mutex; rt_snprintf(name, sizeof(name), "fat%d", drv); - mutex = rt_mutex_create(name, RT_IPC_FLAG_FIFO); + mutex = rt_mutex_create(name, RT_IPC_FLAG_PRIO); if (mutex != RT_NULL) { *m = mutex; diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 29b2068a6c..51ae53de17 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -63,7 +63,7 @@ int dfs_init(void) memset(&_fdtab, 0, sizeof(_fdtab)); /* create device filesystem lock */ - rt_mutex_init(&fslock, "fslock", RT_IPC_FLAG_FIFO); + rt_mutex_init(&fslock, "fslock", RT_IPC_FLAG_PRIO); #ifdef DFS_USING_WORKDIR /* set current working directory */ diff --git a/components/drivers/i2c/i2c_core.c b/components/drivers/i2c/i2c_core.c index 47ba76d2be..c629765f65 100644 --- a/components/drivers/i2c/i2c_core.c +++ b/components/drivers/i2c/i2c_core.c @@ -24,7 +24,7 @@ rt_err_t rt_i2c_bus_device_register(struct rt_i2c_bus_device *bus, { rt_err_t res = RT_EOK; - rt_mutex_init(&bus->lock, "i2c_bus_lock", RT_IPC_FLAG_FIFO); + rt_mutex_init(&bus->lock, "i2c_bus_lock", RT_IPC_FLAG_PRIO); if (bus->timeout == 0) bus->timeout = RT_TICK_PER_SECOND; diff --git a/components/drivers/rtc/alarm.c b/components/drivers/rtc/alarm.c index 2bcc51f2ee..973e6432d0 100644 --- a/components/drivers/rtc/alarm.c +++ b/components/drivers/rtc/alarm.c @@ -790,7 +790,7 @@ int rt_alarm_system_init(void) rt_list_init(&_container.head); rt_event_init(&_container.event, "alarmsvc", RT_IPC_FLAG_FIFO); - rt_mutex_init(&_container.mutex, "alarmsvc", RT_IPC_FLAG_FIFO); + rt_mutex_init(&_container.mutex, "alarmsvc", RT_IPC_FLAG_PRIO); tid = rt_thread_create("alarmsvc", rt_alarmsvc_thread_init, RT_NULL, diff --git a/components/drivers/sdio/mmcsd_core.c b/components/drivers/sdio/mmcsd_core.c index e3bf97069c..8c7062722d 100644 --- a/components/drivers/sdio/mmcsd_core.c +++ b/components/drivers/sdio/mmcsd_core.c @@ -708,7 +708,7 @@ struct rt_mmcsd_host *mmcsd_alloc_host(void) host->max_blk_size = 512; host->max_blk_count = 4096; - rt_mutex_init(&host->bus_lock, "sd_bus_lock", RT_IPC_FLAG_FIFO); + rt_mutex_init(&host->bus_lock, "sd_bus_lock", RT_IPC_FLAG_PRIO); rt_sem_init(&host->sem_ack, "sd_ack", 0, RT_IPC_FLAG_FIFO); return host; diff --git a/components/drivers/sensors/sensor.c b/components/drivers/sensors/sensor.c index 8d43a7a905..951c0a9a62 100644 --- a/components/drivers/sensors/sensor.c +++ b/components/drivers/sensors/sensor.c @@ -452,7 +452,7 @@ int rt_hw_sensor_register(rt_sensor_t sensor, if (sensor->module != RT_NULL && sensor->module->lock == RT_NULL) { /* Create a mutex lock for the module */ - sensor->module->lock = rt_mutex_create(name, RT_IPC_FLAG_FIFO); + sensor->module->lock = rt_mutex_create(name, RT_IPC_FLAG_PRIO); if (sensor->module->lock == RT_NULL) { rt_free(device_name); diff --git a/components/drivers/spi/enc28j60.c b/components/drivers/spi/enc28j60.c index f99719245b..f8e5582e10 100644 --- a/components/drivers/spi/enc28j60.c +++ b/components/drivers/spi/enc28j60.c @@ -834,7 +834,7 @@ rt_err_t enc28j60_attach(const char *spi_device_name) enc28j60_dev.parent.eth_rx = enc28j60_rx; enc28j60_dev.parent.eth_tx = enc28j60_tx; - rt_mutex_init(&enc28j60_dev.lock, "enc28j60", RT_IPC_FLAG_FIFO); + rt_mutex_init(&enc28j60_dev.lock, "enc28j60", RT_IPC_FLAG_PRIO); eth_device_init(&(enc28j60_dev.parent), "e0"); diff --git a/components/drivers/spi/spi_core.c b/components/drivers/spi/spi_core.c index 7b6b7a0763..cc48f78dd9 100644 --- a/components/drivers/spi/spi_core.c +++ b/components/drivers/spi/spi_core.c @@ -29,7 +29,7 @@ rt_err_t rt_spi_bus_register(struct rt_spi_bus *bus, return result; /* initialize mutex lock */ - rt_mutex_init(&(bus->lock), name, RT_IPC_FLAG_FIFO); + rt_mutex_init(&(bus->lock), name, RT_IPC_FLAG_PRIO); /* set ops */ bus->ops = ops; /* initialize owner */ diff --git a/components/drivers/spi/spi_flash_sfud.c b/components/drivers/spi/spi_flash_sfud.c index bcc49e8df4..30bc77a57d 100644 --- a/components/drivers/spi/spi_flash_sfud.c +++ b/components/drivers/spi/spi_flash_sfud.c @@ -318,7 +318,7 @@ rt_spi_flash_device_t rt_sfud_flash_probe_ex(const char *spi_flash_dev_name, con if (rtt_dev) { rt_memset(rtt_dev, 0, sizeof(struct spi_flash_device)); /* initialize lock */ - rt_mutex_init(&(rtt_dev->lock), spi_flash_dev_name, RT_IPC_FLAG_FIFO); + rt_mutex_init(&(rtt_dev->lock), spi_flash_dev_name, RT_IPC_FLAG_PRIO); } if (rtt_dev && sfud_dev && spi_flash_dev_name_bak && spi_dev_name_bak) { diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index af90f13c6f..bfb07fa950 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -451,7 +451,7 @@ rt_pipe_t *rt_pipe_create(const char *name, int bufsz) rt_memset(pipe, 0, sizeof(rt_pipe_t)); pipe->is_named = RT_TRUE; /* initialize as a named pipe */ - rt_mutex_init(&(pipe->lock), name, RT_IPC_FLAG_FIFO); + rt_mutex_init(&(pipe->lock), name, RT_IPC_FLAG_PRIO); rt_wqueue_init(&(pipe->reader_queue)); rt_wqueue_init(&(pipe->writer_queue)); diff --git a/components/drivers/wlan/wlan_cfg.c b/components/drivers/wlan/wlan_cfg.c index 0befe6e7da..24a37e0b72 100644 --- a/components/drivers/wlan/wlan_cfg.c +++ b/components/drivers/wlan/wlan_cfg.c @@ -84,7 +84,7 @@ void rt_wlan_cfg_init(void) rt_memset(cfg_cache, 0, sizeof(struct rt_wlan_cfg_des)); } /* init mutex lock */ - rt_mutex_init(&cfg_mutex, "wlan_cfg", RT_IPC_FLAG_FIFO); + rt_mutex_init(&cfg_mutex, "wlan_cfg", RT_IPC_FLAG_PRIO); } } diff --git a/components/drivers/wlan/wlan_dev.c b/components/drivers/wlan/wlan_dev.c index 4db8d5e43d..49c39f1fd1 100644 --- a/components/drivers/wlan/wlan_dev.c +++ b/components/drivers/wlan/wlan_dev.c @@ -650,7 +650,7 @@ static rt_err_t _rt_wlan_dev_init(rt_device_t dev) struct rt_wlan_device *wlan = (struct rt_wlan_device *)dev; rt_err_t result = RT_EOK; - rt_mutex_init(&wlan->lock, "wlan_dev", RT_IPC_FLAG_FIFO); + rt_mutex_init(&wlan->lock, "wlan_dev", RT_IPC_FLAG_PRIO); if (wlan->ops->wlan_init) result = wlan->ops->wlan_init(wlan); diff --git a/components/drivers/wlan/wlan_mgnt.c b/components/drivers/wlan/wlan_mgnt.c index 6abac5691c..fd16469028 100644 --- a/components/drivers/wlan/wlan_mgnt.c +++ b/components/drivers/wlan/wlan_mgnt.c @@ -2011,10 +2011,10 @@ int rt_wlan_init(void) rt_memset(&_ap_mgnt, 0, sizeof(struct rt_wlan_mgnt_des)); rt_memset(&scan_result, 0, sizeof(struct rt_wlan_scan_result)); rt_memset(&sta_info, 0, sizeof(struct rt_wlan_sta_des)); - rt_mutex_init(&mgnt_mutex, "mgnt", RT_IPC_FLAG_FIFO); - rt_mutex_init(&scan_result_mutex, "scan", RT_IPC_FLAG_FIFO); - rt_mutex_init(&sta_info_mutex, "sta", RT_IPC_FLAG_FIFO); - rt_mutex_init(&complete_mutex, "complete", RT_IPC_FLAG_FIFO); + rt_mutex_init(&mgnt_mutex, "mgnt", RT_IPC_FLAG_PRIO); + rt_mutex_init(&scan_result_mutex, "scan", RT_IPC_FLAG_PRIO); + rt_mutex_init(&sta_info_mutex, "sta", RT_IPC_FLAG_PRIO); + rt_mutex_init(&complete_mutex, "complete", RT_IPC_FLAG_PRIO); #ifdef RT_WLAN_AUTO_CONNECT_ENABLE rt_timer_init(&reconnect_time, "wifi_tim", rt_wlan_cyclic_check, RT_NULL, rt_tick_from_millisecond(AUTO_CONNECTION_PERIOD_MS), diff --git a/components/libc/posix/pthreads/pthread_mutex.c b/components/libc/posix/pthreads/pthread_mutex.c index a681380b11..7bc5ff95c7 100644 --- a/components/libc/posix/pthreads/pthread_mutex.c +++ b/components/libc/posix/pthreads/pthread_mutex.c @@ -121,7 +121,7 @@ int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) mutex->attr = *attr; /* init mutex lock */ - result = rt_mutex_init(&(mutex->lock), name, RT_IPC_FLAG_FIFO); + result = rt_mutex_init(&(mutex->lock), name, RT_IPC_FLAG_PRIO); if (result != RT_EOK) return EINVAL; diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c index 96ea053f9c..e9dabbe03d 100644 --- a/components/net/at/at_socket/at_socket.c +++ b/components/net/at/at_socket/at_socket.c @@ -313,7 +313,7 @@ static struct at_socket *alloc_socket_by_device(struct at_device *device, enum a if (at_slock == RT_NULL) { /* create AT socket lock */ - at_slock = rt_mutex_create("at_slock", RT_IPC_FLAG_FIFO); + at_slock = rt_mutex_create("at_slock", RT_IPC_FLAG_PRIO); if (at_slock == RT_NULL) { LOG_E("No memory for socket allocation lock!"); @@ -367,7 +367,7 @@ static struct at_socket *alloc_socket_by_device(struct at_device *device, enum a rt_snprintf(name, RT_NAME_MAX, "%s%d", "at_skt", idx); /* create AT socket receive ring buffer lock */ - if((sock->recv_lock = rt_mutex_create(name, RT_IPC_FLAG_FIFO)) == RT_NULL) + if((sock->recv_lock = rt_mutex_create(name, RT_IPC_FLAG_PRIO)) == RT_NULL) { LOG_E("No memory for socket receive mutex create."); rt_sem_delete(sock->recv_notice); diff --git a/components/net/at/src/at_client.c b/components/net/at/src/at_client.c index 845d8c0fa6..4eb2c055ba 100644 --- a/components/net/at/src/at_client.c +++ b/components/net/at/src/at_client.c @@ -835,7 +835,7 @@ static int at_client_para_init(at_client_t client) } rt_snprintf(name, RT_NAME_MAX, "%s%d", AT_CLIENT_LOCK_NAME, at_client_num); - client->lock = rt_mutex_create(name, RT_IPC_FLAG_FIFO); + client->lock = rt_mutex_create(name, RT_IPC_FLAG_PRIO); if (client->lock == RT_NULL) { LOG_E("AT client initialize failed! at_client_recv_lock create failed!"); diff --git a/components/net/lwip-1.4.1/src/arch/sys_arch.c b/components/net/lwip-1.4.1/src/arch/sys_arch.c index 0bdce1e075..793568d836 100644 --- a/components/net/lwip-1.4.1/src/arch/sys_arch.c +++ b/components/net/lwip-1.4.1/src/arch/sys_arch.c @@ -341,7 +341,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex) rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter); counter ++; - tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO); + tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO); if (tmpmutex == RT_NULL) return ERR_MEM; else diff --git a/components/net/lwip-2.0.2/src/arch/sys_arch.c b/components/net/lwip-2.0.2/src/arch/sys_arch.c index 4d0c57eff9..3de85b338c 100644 --- a/components/net/lwip-2.0.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.0.2/src/arch/sys_arch.c @@ -352,7 +352,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex) rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter); counter ++; - tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO); + tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO); if (tmpmutex == RT_NULL) return ERR_MEM; else diff --git a/components/net/lwip-2.0.3/src/arch/sys_arch.c b/components/net/lwip-2.0.3/src/arch/sys_arch.c index 4d0c57eff9..3de85b338c 100644 --- a/components/net/lwip-2.0.3/src/arch/sys_arch.c +++ b/components/net/lwip-2.0.3/src/arch/sys_arch.c @@ -352,7 +352,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex) rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter); counter ++; - tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO); + tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO); if (tmpmutex == RT_NULL) return ERR_MEM; else diff --git a/components/net/lwip-2.1.2/src/arch/sys_arch.c b/components/net/lwip-2.1.2/src/arch/sys_arch.c index 5107708a8a..0631a68369 100644 --- a/components/net/lwip-2.1.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.1.2/src/arch/sys_arch.c @@ -360,7 +360,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex) rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter); counter ++; - tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO); + tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO); if (tmpmutex == RT_NULL) return ERR_MEM; else diff --git a/components/net/sal_socket/src/sal_socket.c b/components/net/sal_socket/src/sal_socket.c index 7b33038d17..8f4ac915eb 100644 --- a/components/net/sal_socket/src/sal_socket.c +++ b/components/net/sal_socket/src/sal_socket.c @@ -135,7 +135,7 @@ int sal_init(void) rt_memset(sal_dev_res_tbl, 0, sizeof(sal_dev_res_tbl)); /* create sal socket lock */ - rt_mutex_init(&sal_core_lock, "sal_lock", RT_IPC_FLAG_FIFO); + rt_mutex_init(&sal_core_lock, "sal_lock", RT_IPC_FLAG_PRIO); LOG_I("Socket Abstraction Layer initialize success."); init_ok = RT_TRUE; |
