diff options
Diffstat (limited to 'linden/indra/llcommon/llqueuedthread.cpp')
-rw-r--r-- | linden/indra/llcommon/llqueuedthread.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/linden/indra/llcommon/llqueuedthread.cpp b/linden/indra/llcommon/llqueuedthread.cpp index aa62da8..caf4c2a 100644 --- a/linden/indra/llcommon/llqueuedthread.cpp +++ b/linden/indra/llcommon/llqueuedthread.cpp | |||
@@ -348,9 +348,9 @@ bool LLQueuedThread::completeRequest(handle_t handle) | |||
348 | #if _DEBUG | 348 | #if _DEBUG |
349 | // llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl; | 349 | // llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl; |
350 | #endif | 350 | #endif |
351 | mRequestHash.erase(handle); | 351 | //re insert to the queue to schedule for a delete later |
352 | req->deleteRequest(); | 352 | req->setStatus(STATUS_DELETE); |
353 | // check(); | 353 | mRequestQueue.insert(req); |
354 | res = true; | 354 | res = true; |
355 | } | 355 | } |
356 | unlockData(); | 356 | unlockData(); |
@@ -394,11 +394,19 @@ S32 LLQueuedThread::processNextRequest() | |||
394 | } | 394 | } |
395 | req = *mRequestQueue.begin(); | 395 | req = *mRequestQueue.begin(); |
396 | mRequestQueue.erase(mRequestQueue.begin()); | 396 | mRequestQueue.erase(mRequestQueue.begin()); |
397 | |||
398 | if(req->getStatus() == STATUS_DELETE) | ||
399 | { | ||
400 | mRequestHash.erase(req); | ||
401 | req->deleteRequest(); | ||
402 | continue; | ||
403 | } | ||
404 | |||
397 | if ((req->getFlags() & FLAG_ABORT) || (mStatus == QUITTING)) | 405 | if ((req->getFlags() & FLAG_ABORT) || (mStatus == QUITTING)) |
398 | { | 406 | { |
399 | req->setStatus(STATUS_ABORTED); | 407 | req->setStatus(STATUS_ABORTED); |
400 | req->finishRequest(false); | 408 | req->finishRequest(false); |
401 | if (req->getFlags() & FLAG_AUTO_COMPLETE) | 409 | if ((req->getFlags() & FLAG_AUTO_COMPLETE)) |
402 | { | 410 | { |
403 | mRequestHash.erase(req); | 411 | mRequestHash.erase(req); |
404 | req->deleteRequest(); | 412 | req->deleteRequest(); |
@@ -427,14 +435,17 @@ S32 LLQueuedThread::processNextRequest() | |||
427 | { | 435 | { |
428 | lockData(); | 436 | lockData(); |
429 | req->setStatus(STATUS_COMPLETE); | 437 | req->setStatus(STATUS_COMPLETE); |
438 | unlockData(); | ||
439 | |||
430 | req->finishRequest(true); | 440 | req->finishRequest(true); |
431 | if (req->getFlags() & FLAG_AUTO_COMPLETE) | 441 | |
442 | if ((req->getFlags() & FLAG_AUTO_COMPLETE)) | ||
432 | { | 443 | { |
444 | lockData(); | ||
433 | mRequestHash.erase(req); | 445 | mRequestHash.erase(req); |
434 | req->deleteRequest(); | 446 | req->deleteRequest(); |
435 | // check(); | 447 | unlockData(); |
436 | } | 448 | } |
437 | unlockData(); | ||
438 | } | 449 | } |
439 | else | 450 | else |
440 | { | 451 | { |