mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
libs/libc: There is no need to use sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -92,13 +92,6 @@ int aio_suspend(FAR const struct aiocb * const list[], int nent,
|
||||
|
||||
DEBUGASSERT(list);
|
||||
|
||||
/* Lock the scheduler so that no I/O events can complete on the worker
|
||||
* thread until we set our wait set up. Pre-emption will, of course, be
|
||||
* re-enabled while we are waiting for the signal.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Check each entry in the list. Break out of the loop if any entry
|
||||
* has completed.
|
||||
*/
|
||||
@@ -111,7 +104,6 @@ int aio_suspend(FAR const struct aiocb * const list[], int nent,
|
||||
{
|
||||
/* Yes, return success */
|
||||
|
||||
sched_unlock();
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +120,6 @@ int aio_suspend(FAR const struct aiocb * const list[], int nent,
|
||||
sigaddset(&set, SIGPOLL);
|
||||
|
||||
ret = sigtimedwait(&set, NULL, timeout);
|
||||
sched_unlock();
|
||||
return ret >= 0 ? OK : ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,10 +160,6 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext)
|
||||
DEBUGASSERT(sighand && sighand->list);
|
||||
aiocbp->aio_priv = NULL;
|
||||
|
||||
/* Prevent any asynchronous I/O completions while the signal handler runs */
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Check if all of the pending I/O has completed */
|
||||
|
||||
ret = lio_checkio(sighand->list, sighand->nent);
|
||||
@@ -188,8 +184,6 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext)
|
||||
|
||||
lib_free(sighand);
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -50,7 +50,6 @@ int sigpause(int signo)
|
||||
|
||||
/* Get the current set of blocked signals */
|
||||
|
||||
sched_lock();
|
||||
ret = sigprocmask(SIG_SETMASK, NULL, &set);
|
||||
if (ret == OK)
|
||||
{
|
||||
@@ -66,6 +65,5 @@ int sigpause(int signo)
|
||||
ret = sigsuspend(&set);
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ int chdir(FAR const char *path)
|
||||
* support 'cd -' in NSH)
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
oldpwd = getenv("PWD");
|
||||
if (!oldpwd)
|
||||
{
|
||||
@@ -122,7 +121,6 @@ int chdir(FAR const char *path)
|
||||
|
||||
ret = setenv("PWD", abspath, TRUE);
|
||||
lib_free(abspath);
|
||||
sched_unlock();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user