| 1 | # $Id: TSTP.pm,v 1.3 2002/12/17 18:10:21 matt Exp $ | ||||||||||||
| 2 | |||||||||||||
| 3 | package POE::Component::TSTP; | ||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use POE; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use vars qw($VERSION); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | $VERSION = '0.02'; | |||||||||||
| 9 | |||||||||||||
| 10 | 0 | ▶ | sub create { | ||||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 11 | 0 | my $class = shift; | |||||||||||
| 12 | 0 | my %args = @_; | |||||||||||
| 13 | |||||||||||||
| 14 | POE::Session->create( | ||||||||||||
| 15 | inline_states => { | ||||||||||||
| 16 | _start => \&new, | ||||||||||||
| 17 | sigtstp => \&sigtstp, | ||||||||||||
| 18 | }, | ||||||||||||
| 19 | 0 | args => [ $args{Alias}, $args{PreSuspend}, $args{PostSuspend} ], | |||||||||||
| 20 | ); | ||||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 24 | 0 | my ($kernel, $heap, $alias, $pre, $post) = | |||||||||||
| 25 | @_[KERNEL, HEAP, ARG0, ARG1, ARG2]; | ||||||||||||
| 26 | |||||||||||||
| 27 | 0 | $kernel->sig(TSTP => 'sigtstp'); | |||||||||||
| 28 | 0 | ▶ | $kernel->alias_set($alias || 'tstp_handler'); | ||||||||||
|
Condition0%0/2
$alias || 'tstp_handler'
MC/DC0%0/1
$alias || 'tstp_handler'
$alias
Truth table0%0/2
A
A= $alias
| |||||||||||||
| 29 | 0 | $heap->{PreSuspend} = $pre; | |||||||||||
| 30 | 0 | $heap->{PostSuspend} = $post; | |||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | 0 | ▶ | sub sigtstp { | ||||||||||
|
Subroutine
sigtstp: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||
| 34 | 0 | ▶ | $_[HEAP]->{PreSuspend}->(@_) if $_[HEAP]->{PreSuspend}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 35 | 0 | local $SIG{TSTP} = 'DEFAULT'; | |||||||||||
| 36 | 0 | kill(TSTP => $$); | |||||||||||
| 37 | 0 | $_[KERNEL]->sig_handled(); | |||||||||||
| 38 | 0 | ▶ | $_[HEAP]->{PostSuspend}->(@_) if $_[HEAP]->{PostSuspend}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 1 | 1; | |||||||||||
| 42 | __END__ | ||||||||||||