From 4788b67a54f197d5eb30de904386124f98560c92 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Fri, 20 Dec 2024 09:42:09 -0800 Subject: [PATCH] Gather the results from each thread *after* the thread finishes --- tests/feature-filter/out/filtered.json.standard | 4 ++-- tests/join-population/concat.mbtiles.json | 4 ++-- tests/join-population/joined-no-tile-stats.mbtiles.json | 4 ++-- tests/join-population/joined-null.mbtiles.json | 4 ++-- .../joined-tile-stats-attributes-limit.mbtiles.json | 4 ++-- .../joined-tile-stats-sample-values-limit.mbtiles.json | 4 ++-- .../joined-tile-stats-values-limit.mbtiles.json | 4 ++-- tests/join-population/joined.mbtiles.json | 4 ++-- tests/join-population/macarthur-6-9-exclude.mbtiles.json | 4 ++-- tests/join-population/macarthur-6-9.mbtiles.json | 4 ++-- tests/join-population/no-macarthur.mbtiles.json | 4 ++-- tests/join-population/renamed.mbtiles.json | 4 ++-- tests/join-population/windows.mbtiles.json | 4 ++-- tile-join.cpp | 8 ++++---- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/feature-filter/out/filtered.json.standard b/tests/feature-filter/out/filtered.json.standard index 460d6256..4d9ae0dd 100644 --- a/tests/feature-filter/out/filtered.json.standard +++ b/tests/feature-filter/out/filtered.json.standard @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "0.000000,0.000000,0.000000,0.000000", -"bounds": "0.000000,0.000000,0.000000,0.000000", +"antimeridian_adjusted_bounds": "-180.000000,0.000000,0.966797,85.051129", +"bounds": "-180.000000,0.000000,0.966797,85.051129", "center": "0.000000,0.000000,0", "description": "tests/feature-filter/out/all.mbtiles", "format": "pbf", diff --git a/tests/join-population/concat.mbtiles.json b/tests/join-population/concat.mbtiles.json index 1d18b97a..156596d7 100644 --- a/tests/join-population/concat.mbtiles.json +++ b/tests/join-population/concat.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "0.000000,0.000000,0.000000,0.000000", -"bounds": "0.000000,0.000000,0.000000,0.000000", +"antimeridian_adjusted_bounds": "-122.255859,37.718590,-122.080078,37.857507", +"bounds": "-122.255859,37.718590,-122.080078,37.857507", "center": "-122.104097,37.695438,0", "description": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "format": "pbf", diff --git a/tests/join-population/joined-no-tile-stats.mbtiles.json b/tests/join-population/joined-no-tile-stats.mbtiles.json index 2e36d31e..92a87d2e 100644 --- a/tests/join-population/joined-no-tile-stats.mbtiles.json +++ b/tests/join-population/joined-no-tile-stats.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-135.000000,37.877021,-122.280579,40.979898", -"bounds": "-135.000000,37.877021,-122.280579,40.979898", +"antimeridian_adjusted_bounds": "-135.000000,37.874853,-122.280579,40.979898", +"bounds": "-135.000000,37.874853,-122.280579,40.979898", "center": "-122.299805,37.892187,12", "description": "tests/join-population/tabblock_06001420.mbtiles", "format": "pbf", diff --git a/tests/join-population/joined-null.mbtiles.json b/tests/join-population/joined-null.mbtiles.json index a2ff7cc4..3d2a912e 100644 --- a/tests/join-population/joined-null.mbtiles.json +++ b/tests/join-population/joined-null.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-135.000000,37.877021,-122.280579,40.979898", -"bounds": "-135.000000,37.877021,-122.280579,40.979898", +"antimeridian_adjusted_bounds": "-135.000000,37.874853,-122.280579,40.979898", +"bounds": "-135.000000,37.874853,-122.280579,40.979898", "center": "-122.299805,37.892187,12", "description": "tests/join-population/tabblock_06001420.mbtiles", "format": "pbf", diff --git a/tests/join-population/joined-tile-stats-attributes-limit.mbtiles.json b/tests/join-population/joined-tile-stats-attributes-limit.mbtiles.json index 89245614..7afa4f11 100644 --- a/tests/join-population/joined-tile-stats-attributes-limit.mbtiles.json +++ b/tests/join-population/joined-tile-stats-attributes-limit.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-135.000000,37.877021,-122.280579,40.979898", -"bounds": "-135.000000,37.877021,-122.280579,40.979898", +"antimeridian_adjusted_bounds": "-135.000000,37.874853,-122.280579,40.979898", +"bounds": "-135.000000,37.874853,-122.280579,40.979898", "center": "-122.299805,37.892187,12", "description": "tests/join-population/tabblock_06001420.mbtiles", "format": "pbf", diff --git a/tests/join-population/joined-tile-stats-sample-values-limit.mbtiles.json b/tests/join-population/joined-tile-stats-sample-values-limit.mbtiles.json index dad62899..b0b4c3f8 100644 --- a/tests/join-population/joined-tile-stats-sample-values-limit.mbtiles.json +++ b/tests/join-population/joined-tile-stats-sample-values-limit.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-135.000000,37.877021,-122.280579,40.979898", -"bounds": "-135.000000,37.877021,-122.280579,40.979898", +"antimeridian_adjusted_bounds": "-135.000000,37.874853,-122.280579,40.979898", +"bounds": "-135.000000,37.874853,-122.280579,40.979898", "center": "-122.299805,37.892187,12", "description": "tests/join-population/tabblock_06001420.mbtiles", "format": "pbf", diff --git a/tests/join-population/joined-tile-stats-values-limit.mbtiles.json b/tests/join-population/joined-tile-stats-values-limit.mbtiles.json index 75172022..517f1f24 100644 --- a/tests/join-population/joined-tile-stats-values-limit.mbtiles.json +++ b/tests/join-population/joined-tile-stats-values-limit.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-135.000000,37.877021,-122.280579,40.979898", -"bounds": "-135.000000,37.877021,-122.280579,40.979898", +"antimeridian_adjusted_bounds": "-135.000000,37.874853,-122.280579,40.979898", +"bounds": "-135.000000,37.874853,-122.280579,40.979898", "center": "-122.299805,37.892187,12", "description": "tests/join-population/tabblock_06001420.mbtiles", "format": "pbf", diff --git a/tests/join-population/joined.mbtiles.json b/tests/join-population/joined.mbtiles.json index c1232739..acd23ed2 100644 --- a/tests/join-population/joined.mbtiles.json +++ b/tests/join-population/joined.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-135.000000,37.877021,-122.280579,40.979898", -"bounds": "-135.000000,37.877021,-122.280579,40.979898", +"antimeridian_adjusted_bounds": "-135.000000,37.874853,-122.280579,40.979898", +"bounds": "-135.000000,37.874853,-122.280579,40.979898", "center": "-122.299805,37.892187,12", "description": "tests/join-population/tabblock_06001420.mbtiles", "format": "pbf", diff --git a/tests/join-population/macarthur-6-9-exclude.mbtiles.json b/tests/join-population/macarthur-6-9-exclude.mbtiles.json index 3f3f0eea..f079ea24 100644 --- a/tests/join-population/macarthur-6-9-exclude.mbtiles.json +++ b/tests/join-population/macarthur-6-9-exclude.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.104111,37.833107", -"bounds": "-122.294655,37.695231,-122.104111,37.833107", +"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.103424,37.833107", +"bounds": "-122.294655,37.695231,-122.103424,37.833107", "center": "-122.167969,37.833010,9", "description": "tests/join-population/macarthur.mbtiles", "format": "pbf", diff --git a/tests/join-population/macarthur-6-9.mbtiles.json b/tests/join-population/macarthur-6-9.mbtiles.json index 944a79d9..0452f638 100644 --- a/tests/join-population/macarthur-6-9.mbtiles.json +++ b/tests/join-population/macarthur-6-9.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.104111,37.833107", -"bounds": "-122.294655,37.695231,-122.104111,37.833107", +"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.103424,37.833107", +"bounds": "-122.294655,37.695231,-122.103424,37.833107", "center": "-122.167969,37.833010,9", "description": "tests/join-population/macarthur.mbtiles", "format": "pbf", diff --git a/tests/join-population/no-macarthur.mbtiles.json b/tests/join-population/no-macarthur.mbtiles.json index 6ffa3601..db2e7c61 100644 --- a/tests/join-population/no-macarthur.mbtiles.json +++ b/tests/join-population/no-macarthur.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-135.000000,37.877021,-122.280579,40.979898", -"bounds": "-135.000000,37.877021,-122.280579,40.979898", +"antimeridian_adjusted_bounds": "-135.000000,37.874853,-122.280579,40.979898", +"bounds": "-135.000000,37.874853,-122.280579,40.979898", "center": "-122.299805,37.892187,12", "description": "tests/join-population/tabblock_06001420.mbtiles", "format": "pbf", diff --git a/tests/join-population/renamed.mbtiles.json b/tests/join-population/renamed.mbtiles.json index 727b83ff..58bcc153 100644 --- a/tests/join-population/renamed.mbtiles.json +++ b/tests/join-population/renamed.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.103424,37.833107", -"bounds": "-122.294655,37.695231,-122.103424,37.833107", +"antimeridian_adjusted_bounds": "-122.294655,37.694688,-122.103424,37.833649", +"bounds": "-122.294655,37.694688,-122.103424,37.833649", "center": "-122.167969,37.828608,10", "description": "tests/join-population/macarthur2.mbtiles", "format": "pbf", diff --git a/tests/join-population/windows.mbtiles.json b/tests/join-population/windows.mbtiles.json index b095f46a..570b1710 100644 --- a/tests/join-population/windows.mbtiles.json +++ b/tests/join-population/windows.mbtiles.json @@ -1,6 +1,6 @@ { "type": "FeatureCollection", "properties": { -"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.103424,37.833107", -"bounds": "-122.294655,37.695231,-122.103424,37.833107", +"antimeridian_adjusted_bounds": "-122.294655,37.694688,-122.103424,37.833649", +"bounds": "-122.294655,37.694688,-122.103424,37.833649", "center": "-122.167969,37.833010,10", "description": "tests/join-population/macarthur.mbtiles", "format": "pbf", diff --git a/tile-join.cpp b/tile-join.cpp index f8c5552e..18a1c68f 100644 --- a/tile-join.cpp +++ b/tile-join.cpp @@ -1012,6 +1012,10 @@ void dispatch_tasks(std::map> &tasks, std::vector< for (size_t i = 0; i < CPUS; i++) { void *retval; + if (pthread_join(pthreads[i], &retval) != 0) { + perror("pthread_join"); + } + *minlat = std::min(*minlat, args[i].minlat); *minlon = std::min(*minlon, args[i].minlon); *maxlat = std::max(*maxlat, args[i].maxlat); @@ -1019,10 +1023,6 @@ void dispatch_tasks(std::map> &tasks, std::vector< *minlon2 = std::min(*minlon2, args[i].minlon2); *maxlon2 = std::max(*maxlon2, args[i].maxlon2); - if (pthread_join(pthreads[i], &retval) != 0) { - perror("pthread_join"); - } - for (auto ai = args[i].outputs.begin(); ai != args[i].outputs.end(); ++ai) { if (outdb != NULL) { mbtiles_write_tile(outdb, ai->first.z, ai->first.x, ai->first.y, ai->second.data(), ai->second.size());