mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
binfmt: remove sched_[un]lock
In the current usage mode, multiple tasks will not modify g_binfmts simultaneously Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -103,12 +103,6 @@ static int load_absmodule(FAR struct binary_s *bin, FAR const char *filename,
|
|||||||
|
|
||||||
binfo("Loading %s\n", 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
|
/* Traverse the list of registered binary format handlers. Stop
|
||||||
* when either (1) a handler recognized and loads the format, or
|
* when either (1) a handler recognized and loads the format, or
|
||||||
* (2) no handler recognizes the format.
|
* (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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,10 +60,8 @@ int register_binfmt(FAR struct binfmt_s *binfmt)
|
|||||||
* handlers
|
* handlers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sched_lock();
|
|
||||||
binfmt->next = g_binfmts;
|
binfmt->next = g_binfmts;
|
||||||
g_binfmts = binfmt;
|
g_binfmts = binfmt;
|
||||||
sched_unlock();
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,12 +60,6 @@ int unregister_binfmt(FAR struct binfmt_s *binfmt)
|
|||||||
|
|
||||||
if (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
|
/* Search the list of registered binary format handlers for the
|
||||||
* one to be unregistered.
|
* one to be unregistered.
|
||||||
*/
|
*/
|
||||||
@@ -96,8 +90,6 @@ int unregister_binfmt(FAR struct binfmt_s *binfmt)
|
|||||||
binfmt->next = NULL;
|
binfmt->next = NULL;
|
||||||
ret = OK;
|
ret = OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
sched_unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user