ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP/Kernel.pm
(Generate patch)

Comparing AnyEvent-MP/MP/Kernel.pm (file contents):
Revision 1.73 by root, Thu Mar 1 18:11:56 2012 UTC vs.
Revision 1.74 by root, Thu Mar 1 18:31:42 2012 UTC

668# master selection 668# master selection
669 669
670# master requests 670# master requests
671our %GLOBAL_REQ; # $id => \@req 671our %GLOBAL_REQ; # $id => \@req
672 672
673sub global_req { 673sub global_req_add {
674 my $req = [@_]; 674 my $id = shift;
675 675
676 $GLOBAL_REQ{$req+0} = $req; 676 return if exists $GLOBAL_REQ{$id};
677
678 $GLOBAL_REQ{$id} = [@_];
677 679
678 snd $MASTER, @_ 680 snd $MASTER, @_
679 if $MASTER; 681 if $MASTER;
682}
680 683
681 defined wantarray && AnyEvent::Util::guard { delete $GLOBAL_REQ{$req} } 684sub global_req_del {
685 delete $GLOBAL_REQ{$_[0]};
686}
687
688sub g_find {
689 global_req_add "g_find $_[0]", g_find => $_[0];
682} 690}
683 691
684# reply for g_find started in Node.pm 692# reply for g_find started in Node.pm
685$node_req{g_found} = sub { 693$node_req{g_found} = sub {
694 global_req_del "g_find $_[0]";
695
686 @{ $_[1] } or return; # d'oh 696 @{ $_[1] } or return; # d'oh
687 697
688 my $node = $NODE{$_[0]} or return; 698 my $node = $NODE{$_[0]} or return;
689 699
690 local $GLOBAL_DB{"'l"}{$_[0]} = $_[1]; #d# UGLY 700 local $GLOBAL_DB{"'l"}{$_[0]} = $_[1]; #d# UGLY

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines