Skip to content

Commit

Permalink
graphics: remove sched_[un]lock
Browse files Browse the repository at this point in the history
Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jul 29, 2023
1 parent 02153a2 commit 11112ab
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions graphics/nxterm/nxterm_kbdin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
Expand All @@ -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?
*/
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 11112ab

Please sign in to comment.