Commit graph

13 commits

Author SHA1 Message Date
Matt Amos
3d7b84a598 Fix deadlock in recursive datasource registration.
The datasource cache was taking an exclusive lock on the simple
mutex used to protect the singleton's data pointer. This works
okay when everyone always calls it non-recursively, but when the
recursive flag is true then it will always deadlock when called
on any directory with subdirectories.

Additionally, many methods which accessed private data members of
the cache were not protected by any locks.

Since the call pattern of registering datasources is strictly
tree-shaped then it's a good candidate for a recursive mutex. This
has a slightly higher overhead than a simple mutex, so rather than
change the singleton's mutex to be recursive, I've added a new
instance mutex to the datasource cache.

Also, added a very basic test which reproduces the problem and
shows that it's fixed with this patch.
2015-08-23 20:25:35 +01:00
Dane Springmeyer
c7693d9765 fix odd inf loop in catch.hpp 2015-06-30 18:47:36 -07:00
Dane Springmeyer
1eea7294ae ensure tests pass with no plugins built 2015-06-30 17:04:48 -07:00
Dane Springmeyer
6d0cd6870b remove dead code 2015-06-15 20:41:52 -07:00
Matt Amos
782a949543 Use approx when testing floating point approximate equality. 2015-05-18 22:53:11 +01:00
Matt Amos
369887428e Use REQUIRE_THROWS instead of manually checking with try/catch. 2015-05-18 22:40:34 +01:00
Matt Amos
26f233c505 Test failure on thrown exception is already handled by the test framework. 2015-05-18 22:37:13 +01:00
Matt Amos
2bb50371ca Need optional I/O header on clang++, apparently. 2015-05-18 22:34:34 +01:00
Matt Amos
a16b6156ed Ported CSV tests from Python. 2015-05-18 22:14:37 +01:00
Matt Amos
8e62007e4f Added port of agg_rasterizer_integer_overflow_test.py 2015-05-18 14:46:01 +01:00
Dane Springmeyer
77d9c886a2 fix paths for font_registration_test.cpp - refs #2787 2015-04-30 07:12:30 -07:00
Dane Springmeyer
d83afb3c75 pull data from test-data repo 2015-04-26 20:23:02 +02:00
Dane Springmeyer
edf7616b19 reorganize c++ tests 2015-04-25 22:08:12 +02:00