Fixes: NB#256863 - Race when starting and deleting requests at the same time
authorAdrien Bustany <adrien.bustany@nokia.com>
Fri, 20 May 2011 13:28:23 +0000 (16:28 +0300)
committerMathias Hasselmann <mathias@openismus.com>
Fri, 20 May 2011 21:48:10 +0000 (23:48 +0200)
commitf72b769f5a8e2857f51f4ff72319d2a46a45343a
tree7bba09609a0b8254029895b0fde15dcee0031245
parent4d15a16ec16782890401b80df1629d498bfe889e
Fixes: NB#256863 - Race when starting and deleting requests at the same time

RevBy: cocos (MR#213)
Details:
This race can happen if the new operator returns twice the same address
when creating the workers. Because we would free the workers when the
request was finished but only remove the requests from the
requestsByWorker map when they were deleted (not when they were
finished), you could remove the worker->request entry in the map when
deleting a request, while having another running request using a worker
with the same address. When the second worker would finish, it would not
find the associated request, and therefore updateContactFetchRequest
would be a no-op.
src/engine/tasks.cpp
src/engine/tasks.h