You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/07/26 16:43:58 UTC

[nuttx] branch master updated: binfmt: remove sched_[un]lock

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4109908013 binfmt: remove sched_[un]lock
4109908013 is described below

commit 4109908013a148a0ceb42cdcfe55ae9807ee6252
Author: hujun5 <hu...@xiaomi.com>
AuthorDate: Mon Jul 3 11:19:14 2023 +0800

    binfmt: remove sched_[un]lock
    
    In the current usage mode, multiple tasks will not modify g_binfmts simultaneously
    
    Signed-off-by: hujun5 <hu...@xiaomi.com>
---
 binfmt/binfmt_loadmodule.c | 7 -------
 binfmt/binfmt_register.c   | 2 --
 binfmt/binfmt_unregister.c | 8 --------
 3 files changed, 17 deletions(-)

diff --git a/binfmt/binfmt_loadmodule.c b/binfmt/binfmt_loadmodule.c
index 3816a7ea9a..f6ccb60c97 100644
--- a/binfmt/binfmt_loadmodule.c
+++ b/binfmt/binfmt_loadmodule.c
@@ -103,12 +103,6 @@ static int load_absmodule(FAR struct binary_s *bin, FAR const char *filename,
 
   binfo("Loading %s\n", filename);
 
-  /* Disabling pre-emption should be sufficient protection while accessing
-   * the list of registered binary format handlers.
-   */
-
-  sched_lock();
-
   /* Traverse the list of registered binary format handlers.  Stop
    * when either (1) a handler recognized and loads the format, or
    * (2) no handler recognizes the format.
@@ -133,7 +127,6 @@ static int load_absmodule(FAR struct binary_s *bin, FAR const char *filename,
         }
     }
 
-  sched_unlock();
   return ret;
 }
 
diff --git a/binfmt/binfmt_register.c b/binfmt/binfmt_register.c
index c594086ad8..88364dbe33 100644
--- a/binfmt/binfmt_register.c
+++ b/binfmt/binfmt_register.c
@@ -60,10 +60,8 @@ int register_binfmt(FAR struct binfmt_s *binfmt)
        * handlers
        */
 
-      sched_lock();
       binfmt->next = g_binfmts;
       g_binfmts    = binfmt;
-      sched_unlock();
       return OK;
     }
 
diff --git a/binfmt/binfmt_unregister.c b/binfmt/binfmt_unregister.c
index b5c447aebf..403f79bde9 100644
--- a/binfmt/binfmt_unregister.c
+++ b/binfmt/binfmt_unregister.c
@@ -60,12 +60,6 @@ int unregister_binfmt(FAR struct binfmt_s *binfmt)
 
   if (binfmt)
     {
-      /* Disabling pre-emption should be sufficient protection while
-       * accessing the list of registered binary format handlers.
-       */
-
-      sched_lock();
-
       /* Search the list of registered binary format handlers for the
        * one to be unregistered.
        */
@@ -96,8 +90,6 @@ int unregister_binfmt(FAR struct binfmt_s *binfmt)
           binfmt->next = NULL;
           ret = OK;
         }
-
-      sched_unlock();
     }
 
   return ret;