+ unless (-d $self->threaddir($param)) {
+ mkdir $self->threaddir($param), 0777 or return;
+ }
+ my $cache = new Lock ($self->cachefile($param));
+
+ unless ($cache -> lock (LH_EXCL)) {
+ $self->set_error ('could not write-lock cache file '.$cache -> filename);
+ }
+ else {
+ unless ($cache -> open (O_APPEND | O_CREAT | O_RDWR)) {
+ $self->set_error ('could not open to read/write/append cache file '.$cache -> filename);
+ }
+ else {
+ $status = $gosub -> (
+ $self,
+ $summary,
+ $cache,
+ $param
+ );
+ unless ($cache -> close) {
+ $status=0;
+ $self->set_error('could not close cache file '.$cache -> filename);
+ }
+ }
+ $cache -> unlock;
+ }
+ unless ($summary -> close) {