Closed tomblench closed 6 years ago
@ricellis I synchronised close
in dd2b6ea because I think there's a race condition where you could get an "orphaned" database.
allOpenDatabases
is a read-only view into the map and it doesn't appear to be used except in test code so I'm not worried about that.
Copyrights and CHANGELOG in 04b3f3f
Note that the log message is intentionally loosely worded - for the same open database you will get different CDTDatastore
objects which all point to the same TD_Database
. This is OK because the former is just a stateless wrapper around the latter.
What
Synchronise access to _databases dictionary, to handle cases where multiple threads interact with the same
CDTDatastoreManager
.Also remove unused method
cachedDatabaseNamed
.How
Add
@synchronized
blocks to stop potential race conditions.Testing
See
xxxTestDatastoreGetThreaded
Issues
Fixes #427 in conjunction with #428