pid_t: unify usage of special task IDs

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko
2022-03-21 23:47:09 +01:00
committed by Xiang Xiao
parent 2ee12b2c5d
commit 68902d8732
150 changed files with 359 additions and 456 deletions
+7 -6
View File
@@ -1689,16 +1689,17 @@ int usbmsc_exportluns(FAR void *handle)
g_usbmsc_handoff = priv;
uinfo("Starting SCSI worker thread\n");
priv->thpid = kthread_create("scsid", CONFIG_USBMSC_SCSI_PRIO,
CONFIG_USBMSC_SCSI_STACKSIZE,
usbmsc_scsi_main, NULL);
if (priv->thpid <= 0)
ret = kthread_create("scsid", CONFIG_USBMSC_SCSI_PRIO,
CONFIG_USBMSC_SCSI_STACKSIZE,
usbmsc_scsi_main, NULL);
if (ret < 0)
{
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_THREADCREATE),
(uint16_t)priv->thpid);
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_THREADCREATE), (uint16_t)ret);
goto errout_with_lock;
}
priv->thpid = (pid_t)ret;
/* Wait for the worker thread to run and initialize */
uinfo("Waiting for the SCSI worker thread\n");