graphics: remove sched_[un]lock

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2023-07-05 20:41:28 +08:00 committed by Xiang Xiao
parent 44b08d3a67
commit 97a2528de9
1 changed files with 2 additions and 14 deletions

View File

@ -128,7 +128,6 @@ ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len)
* to wake us up.
*/
sched_lock();
priv->nwaiters++;
nxmutex_unlock(&priv->lock);
@ -139,13 +138,6 @@ ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len)
ret = nxsem_wait(&priv->waitsem);
/* Pre-emption will be disabled when we return. So the
* decrementing nwaiters here is safe.
*/
priv->nwaiters--;
sched_unlock();
/* Did we successfully get the waitsem? */
if (ret >= 0)
@ -155,6 +147,8 @@ ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len)
ret = nxmutex_lock(&priv->lock);
}
priv->nwaiters--;
/* Was the mutex wait successful? Did we successful re-take the
* mutual exclusion mutex?
*/
@ -421,10 +415,6 @@ void nxterm_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen)
{
int i;
/* Are there threads waiting for read data? */
sched_lock();
/* Notify all poll/select waiters that they can read from the FIFO */
nxterm_pollnotify(priv, POLLIN);
@ -437,8 +427,6 @@ void nxterm_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen)
nxsem_post(&priv->waitsem);
}
sched_unlock();
}
nxmutex_unlock(&priv->lock);