in reply to child process termination on Windows
Depending on what you're doing in the main thread, the child thread could notify it (e.g. via Windows message or socket).use strict; use warnings; use Win32::Process; use Win32; use threads; my $ProcessObj; Win32::Process::Create($ProcessObj, "C:\\windows\\system32\\calc.exe", "", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); print "process created\n"; $| = 1; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } sub wait_proc { $ProcessObj->Wait(INFINITE); print "process finished\n"; } my $thr = threads->create('wait_proc'); print "waiting for input\n"; $_ = <>; print "input is $_\n"; $thr->join;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: child process termination on Windows
by morgon (Priest) on Nov 19, 2009 at 10:05 UTC | |
by ReturnOfThelonious (Beadle) on Nov 20, 2009 at 03:28 UTC | |
by morgon (Priest) on Nov 22, 2009 at 21:02 UTC | |
by ReturnOfThelonious (Beadle) on Nov 24, 2009 at 14:58 UTC |