JobQueue::AddJob() returns error on lock failure.
* If the lock could not be obtained, it will now return B_ERROR instead of B_OK.
This commit is contained in:
@@ -84,7 +84,9 @@ JobQueue::AddJob(BJob* job)
|
||||
return B_NO_INIT;
|
||||
|
||||
BAutolock lock(&fLock);
|
||||
if (lock.IsLocked()) {
|
||||
if (!lock.IsLocked())
|
||||
return B_ERROR;
|
||||
|
||||
try {
|
||||
if (!fQueuedJobs->insert(job).second)
|
||||
return B_NAME_IN_USE;
|
||||
@@ -97,7 +99,6 @@ JobQueue::AddJob(BJob* job)
|
||||
job->AddStateListener(this);
|
||||
if (job->IsRunnable())
|
||||
release_sem(fHaveRunnableJobSem);
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user