backends: Tidy up prepare() and unprepare() methods’ mutual exclusion
authorPhilip Withnall <philip@tecnocode.co.uk>
Thu, 8 Dec 2011 16:21:45 +0000 (16:21 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Fri, 9 Dec 2011 08:53:28 +0000 (08:53 +0000)
commit58dba5a8129e498d7aaf8811597208f347f7ff31
treea3857a95977021cc945f2d3eec29511da9e20fa3
parent8bdeef859e7c094dbd5e2bbd6c918eb88dfb3044
backends: Tidy up prepare() and unprepare() methods’ mutual exclusion

As discovered in bgo#665728, all our prepare() (and unprepare()) methods are
currently vulnerable to being run multiple times concurrently from a single
thread. Add a _pending_prepare flag to all of them to prevent this. It
doesn't need to be locked, since it should only ever be accessed from a
single thread (since only a single thread can get through the lock{}
recursive mutex at once).

Helps: bgo#665728
13 files changed:
backends/eds/eds-backend.vala
backends/eds/lib/edsf-persona-store.vala
backends/key-file/kf-backend.vala
backends/key-file/kf-persona-store.vala
backends/libsocialweb/lib/swf-persona-store.vala
backends/libsocialweb/sw-backend.vala
backends/telepathy/lib/tpf-persona-store.vala
backends/telepathy/tp-backend.vala
backends/tracker/lib/trf-persona-store.vala
backends/tracker/tr-backend.vala
folks/backend.vala
folks/individual-aggregator.vala
folks/persona-store.vala