Thread fork() wirft Fehler Free to wrong pool (Windows)
(21 answers)
Opened by bianca at 2013-09-26 07:53
Wenn ich die Auftragsdatei sofort nach ihrem Auffinden umbenenne nützt das auch nur ein bisschen, der Fehler bleibt aber.
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #!/usr/bin/perl use strict; use warnings; use diagnostics; print "Start\n"; my $lauf = 1; while ($lauf) { if (opendir my $vh,'.') { foreach my $file ( grep { $_ =~ /^[a-z0-9]\-auftrag.dat$/ && !-z $_ } readdir $vh ) { print "Datei $file gefunden\n"; my $pid; if (!($pid = fork())) { # Sohn rename($file,"$file-erl"); print "Sohn gestartet\n"; sleep(5); } } } print "Warte\n"; sleep(2); } print "Ende\n"; Code: (dl
)
1 Start 10 print "Hallo"
20 goto 10 |