mm/iob/iob_notifier.c: Don't check iob_navail in iob_notifier_setup to avoid a potential race condition.
This commit is contained in:
parent
427f8c743c
commit
ee28417246
|
@ -272,30 +272,6 @@ int iob_notifier_setup(int qid, worker_t worker, FAR void *arg);
|
|||
int iob_notifier_teardown(int key);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: iob_notifier_signal
|
||||
*
|
||||
* Description:
|
||||
* An IOB has become available. Signal all threads waiting for an IOB
|
||||
* that an IOB is available.
|
||||
*
|
||||
* When an IOB becomes available, *all* of the workers waiting for an
|
||||
* IOB will be executed. If there are multiple workers for waiting an IOB
|
||||
* then only the first to execute will get the IOB. Others will
|
||||
* need to call iob_notify_setup() once again.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None.
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_IOB_NOTIFIER
|
||||
void iob_notifier_signal(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: iob_free_chain
|
||||
*
|
||||
|
|
|
@ -84,19 +84,6 @@ int iob_notifier_setup(int qid, worker_t worker, FAR void *arg)
|
|||
|
||||
DEBUGASSERT(worker != NULL);
|
||||
|
||||
/* If there are already free IOBs, then return zero without setting up the
|
||||
* notification.
|
||||
*
|
||||
* REVISIT: The 'throttled' argument should not always be 'false'.
|
||||
*/
|
||||
|
||||
if (iob_navail(false) > 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Otherwise, this is just a simple wrapper around work_notifer_setup(). */
|
||||
|
||||
info.evtype = WORK_IOB_AVAIL;
|
||||
info.qid = qid;
|
||||
info.qualifier = NULL;
|
||||
|
|
Loading…
Reference in New Issue