Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
16 lib/P9Y/ProcessTable/Process.pm
@@ -109,21 +109,21 @@ sub kill {
109 109 return CORE::kill($sig, $self->pid);
110 110 }
111 111
112   -sub pgrp {
113   - my ($self, $pgrp) = @_;
114   - return $self->{pgrp} if @_ == 1;
  112 +around pgrp => sub {
  113 + my ($orig, $self, $pgrp) = @_;
  114 + return $orig->($self) if @_ == 2;
115 115
116 116 setpgrp($self->pid, $pgrp);
117 117 $self->_set_pgrp($pgrp);
118   -}
  118 +};
119 119
120   -sub priority {
121   - my ($self, $pri) = @_;
122   - return $self->{priority} if @_ == 1;
  120 +around priority => sub {
  121 + my ($orig, $self, $pri) = @_;
  122 + return $orig->($self) if @_ == 2;
123 123
124 124 setpriority(0, $self->pid, $pri);
125 125 $self->_set_priority($pri);
126   -}
  126 +};
127 127
128 128 42;
129 129
8 lib/P9Y/ProcessTable/Win32.pm
@@ -287,12 +287,12 @@ sub kill {
287 287 }
288 288 }
289 289
290   -sub priority {
291   - my ($self, $pri) = @_;
292   - return $self->{priority} if @_ == 1;
  290 +Class::Method::Modifiers::around priority => sub {
  291 + my ($orig, $self, $pri) = @_;
  292 + return $orig->($self) if @_ == 2;
293 293
294 294 $self->_win32_proc->SetPriorityClass($pri);
295 295 $self->_set_priority($pri);
296   -}
  296 +};
297 297
298 298 42;

No commit comments for this range

Something went wrong with that request. Please try again.