… | |
… | |
1209 | my $guard = cf::lock_acquire "map_find:$key"; |
1209 | my $guard = cf::lock_acquire "map_find:$key"; |
1210 | |
1210 | |
1211 | # do it the slow way |
1211 | # do it the slow way |
1212 | my $map = try_load_header $path->save_path; |
1212 | my $map = try_load_header $path->save_path; |
1213 | |
1213 | |
|
|
1214 | Coro::cede; |
|
|
1215 | |
1214 | if ($map) { |
1216 | if ($map) { |
1215 | $map->last_access ((delete $map->{last_access}) |
1217 | $map->last_access ((delete $map->{last_access}) |
1216 | || $cf::RUNTIME); #d# |
1218 | || $cf::RUNTIME); #d# |
1217 | # safety |
1219 | # safety |
1218 | $map->{instantiate_time} = $cf::RUNTIME |
1220 | $map->{instantiate_time} = $cf::RUNTIME |
… | |
… | |
1237 | |
1239 | |
1238 | $map->path ($key); |
1240 | $map->path ($key); |
1239 | $map->{path} = $path; |
1241 | $map->{path} = $path; |
1240 | $map->{last_save} = $cf::RUNTIME; |
1242 | $map->{last_save} = $cf::RUNTIME; |
1241 | |
1243 | |
|
|
1244 | Coro::cede; |
|
|
1245 | |
1242 | if ($map->should_reset) { |
1246 | if ($map->should_reset) { |
1243 | $map->reset; |
1247 | $map->reset; |
1244 | undef $guard; |
1248 | undef $guard; |
1245 | $map = find $path |
1249 | $map = find $path |
1246 | or return; |
1250 | or return; |
… | |
… | |
1272 | if (aio_open $uniq, O_RDONLY, 0) { |
1276 | if (aio_open $uniq, O_RDONLY, 0) { |
1273 | $self->clear_unique_items; |
1277 | $self->clear_unique_items; |
1274 | $self->load_objects ($uniq, 0); |
1278 | $self->load_objects ($uniq, 0); |
1275 | } |
1279 | } |
1276 | } |
1280 | } |
|
|
1281 | |
|
|
1282 | Coro::cede; |
1277 | |
1283 | |
1278 | # now do the right thing for maps |
1284 | # now do the right thing for maps |
1279 | $self->link_multipart_objects; |
1285 | $self->link_multipart_objects; |
1280 | |
1286 | |
1281 | if ($self->{path}->is_style_map) { |
1287 | if ($self->{path}->is_style_map) { |
… | |
… | |
1289 | $self->difficulty ($self->estimate_difficulty) |
1295 | $self->difficulty ($self->estimate_difficulty) |
1290 | unless $self->difficulty; |
1296 | unless $self->difficulty; |
1291 | $self->activate; |
1297 | $self->activate; |
1292 | } |
1298 | } |
1293 | |
1299 | |
|
|
1300 | Coro::cede; |
|
|
1301 | |
1294 | $self->in_memory (cf::MAP_IN_MEMORY); |
1302 | $self->in_memory (cf::MAP_IN_MEMORY); |
1295 | } |
1303 | } |
1296 | |
1304 | |
1297 | sub find_sync { |
1305 | sub find_sync { |
1298 | my ($path, $origin) = @_; |
1306 | my ($path, $origin) = @_; |