You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/31 09:35:59 UTC

[incubator-nuttx] branch master updated: Change the type of tg_joinlock, mm_lock and md_lock from sem_t to mutex_t

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new e08c296a8e Change the type of tg_joinlock, mm_lock and md_lock from sem_t to mutex_t
e08c296a8e is described below

commit e08c296a8e581aab968ca1bff3e9148ee1a90c9d
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Oct 30 21:28:33 2022 +0800

    Change the type of tg_joinlock, mm_lock and md_lock from sem_t to mutex_t
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 include/nuttx/sched.h                  | 5 +++--
 mm/mm_heap/mm.h                        | 2 +-
 wireless/ieee802154/mac802154_device.c | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h
index 8fe7e5d1d5..64b55c07dd 100644
--- a/include/nuttx/sched.h
+++ b/include/nuttx/sched.h
@@ -31,12 +31,13 @@
 #include <stdint.h>
 #include <sched.h>
 #include <signal.h>
-#include <semaphore.h>
 #include <pthread.h>
 #include <time.h>
 
 #include <nuttx/clock.h>
 #include <nuttx/irq.h>
+#include <nuttx/mutex.h>
+#include <nuttx/semaphore.h>
 #include <nuttx/queue.h>
 #include <nuttx/wdog.h>
 #include <nuttx/mm/shm.h>
@@ -453,7 +454,7 @@ struct task_group_s
 
                               /* 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_jointail; /* Tail of a list of join data            */
 #endif
diff --git a/mm/mm_heap/mm.h b/mm/mm_heap/mm.h
index 9e908a38c3..5cb0205148 100644
--- a/mm/mm_heap/mm.h
+++ b/mm/mm_heap/mm.h
@@ -196,7 +196,7 @@ struct mm_heap_s
    * the following un-named mutex.
    */
 
-  sem_t mm_lock;
+  mutex_t mm_lock;
 
   /* This is the size of the heap provided to mm */
 
diff --git a/wireless/ieee802154/mac802154_device.c b/wireless/ieee802154/mac802154_device.c
index 926e21bd26..bfa3374318 100644
--- a/wireless/ieee802154/mac802154_device.c
+++ b/wireless/ieee802154/mac802154_device.c
@@ -35,6 +35,7 @@
 #include <fcntl.h>
 
 #include <nuttx/arch.h>
+#include <nuttx/mutex.h>
 #include <nuttx/kmalloc.h>
 #include <nuttx/signal.h>
 #include <nuttx/mm/iob.h>
@@ -84,7 +85,7 @@ struct mac802154_chardevice_s
 {
   MACHANDLE md_mac;                     /* Saved binding to the mac layer */
   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 */