Change the type of tg_joinlock, mm_lock and md_lock from sem_t to mutex_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-10-30 21:28:33 +08:00
committed by Petro Karashchenko
parent 18266c1012
commit e08c296a8e
3 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -31,12 +31,13 @@
#include <stdint.h> #include <stdint.h>
#include <sched.h> #include <sched.h>
#include <signal.h> #include <signal.h>
#include <semaphore.h>
#include <pthread.h> #include <pthread.h>
#include <time.h> #include <time.h>
#include <nuttx/clock.h> #include <nuttx/clock.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <nuttx/mutex.h>
#include <nuttx/semaphore.h>
#include <nuttx/queue.h> #include <nuttx/queue.h>
#include <nuttx/wdog.h> #include <nuttx/wdog.h>
#include <nuttx/mm/shm.h> #include <nuttx/mm/shm.h>
@@ -453,7 +454,7 @@ struct task_group_s
/* Pthread join Info: */ /* Pthread join Info: */
sem_t tg_joinlock; /* Mutually exclusive access to join data */ mutex_t tg_joinlock; /* Mutually exclusive access to join data */
FAR struct join_s *tg_joinhead; /* Head of a list of join data */ FAR struct join_s *tg_joinhead; /* Head of a list of join data */
FAR struct join_s *tg_jointail; /* Tail of a list of join data */ FAR struct join_s *tg_jointail; /* Tail of a list of join data */
#endif #endif
+1 -1
View File
@@ -196,7 +196,7 @@ struct mm_heap_s
* the following un-named mutex. * the following un-named mutex.
*/ */
sem_t mm_lock; mutex_t mm_lock;
/* This is the size of the heap provided to mm */ /* This is the size of the heap provided to mm */
+2 -1
View File
@@ -35,6 +35,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/mutex.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/signal.h> #include <nuttx/signal.h>
#include <nuttx/mm/iob.h> #include <nuttx/mm/iob.h>
@@ -84,7 +85,7 @@ struct mac802154_chardevice_s
{ {
MACHANDLE md_mac; /* Saved binding to the mac layer */ MACHANDLE md_mac; /* Saved binding to the mac layer */
struct mac802154dev_callback_s md_cb; /* Callback information */ struct mac802154dev_callback_s md_cb; /* Callback information */
sem_t md_lock; /* Exclusive device access */ mutex_t md_lock; /* Exclusive device access */
/* Hold a list of events */ /* Hold a list of events */