summaryrefslogtreecommitdiffstats
path: root/nova/openstack
diff options
context:
space:
mode:
authorStanislaw Pitucha <stanislaw.pitucha@hp.com>2012-08-06 23:16:07 +0100
committerStanislaw Pitucha <stanislaw.pitucha@hp.com>2012-08-06 23:48:20 +0100
commit9206ee5a63a65e076342896e3b41bbcbf819af56 (patch)
tree1ec60a0efb3f6fd60c1f34ca21affaddf18cd4a0 /nova/openstack
parent50b02218af1b9e093b65b0c9d7a4b091025d96d5 (diff)
downloadnova-9206ee5a63a65e076342896e3b41bbcbf819af56.tar.gz
nova-9206ee5a63a65e076342896e3b41bbcbf819af56.tar.xz
nova-9206ee5a63a65e076342896e3b41bbcbf819af56.zip
Solve possible race in semaphor creation
Solve the race condition described in the bug 872558 report which can result in: - thread crashing trying to remove semaphore from dict - two threads getting different semaphores for the same name First case is solved automatically by weakref dictionary. No explicit deletion takes place. The second case is solved by getting existing or new semaphore in one step. Once a local reference to the semaphore is obtained, it can be safely assigned to the dictionary if it's missing. If it's present, it will not be removed anymore because there's at least one strong reference present (local variable 'sem'). This solution is only valid for greenthreads. Change-Id: I6bddc3e7abb39fd75e1f03abb2ea0f911b761957
Diffstat (limited to 'nova/openstack')
0 files changed, 0 insertions, 0 deletions