Skip to content

Commit bb9879d

Browse files
jdheddenrjbs
jdhedden
authored andcommitted
Upgrade to Thread::Queue 3.08
1 parent 3cfebac commit bb9879d

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ package Maintainers;
11631163
# correct for this (and Thread::Semaphore, threads, and threads::shared)
11641164
# to be under dist/ rather than cpan/
11651165
'Thread::Queue' => {
1166-
'DISTRIBUTION' => 'JDHEDDEN/Thread-Queue-3.07.tar.gz',
1166+
'DISTRIBUTION' => 'JDHEDDEN/Thread-Queue-3.08.tar.gz',
11671167
'FILES' => q[dist/Thread-Queue],
11681168
'EXCLUDED' => [
11691169
qr{^examples/},

dist/Thread-Queue/lib/Thread/Queue.pm

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ Thread::Queue - Thread-safe queues
304304
305305
=head1 VERSION
306306
307-
This document describes Thread::Queue version 3.07
307+
This document describes Thread::Queue version 3.08
308308
309309
=head1 SYNOPSIS
310310
@@ -393,20 +393,20 @@ shared array reference via C<&shared([])>, copy the elements 'foo', 'bar'
393393
and 'baz' from C<@ary> into it, and then place that shared reference onto
394394
the queue:
395395
396-
my @ary = qw/foo bar baz/;
397-
$q->enqueue(\@ary);
396+
my @ary = qw/foo bar baz/;
397+
$q->enqueue(\@ary);
398398
399399
However, for the following, the items are already shared, so their references
400400
are added directly to the queue, and no cloning takes place:
401401
402-
my @ary :shared = qw/foo bar baz/;
403-
$q->enqueue(\@ary);
402+
my @ary :shared = qw/foo bar baz/;
403+
$q->enqueue(\@ary);
404404
405-
my $obj = &shared({});
406-
$$obj{'foo'} = 'bar';
407-
$$obj{'qux'} = 99;
408-
bless($obj, 'My::Class');
409-
$q->enqueue($obj);
405+
my $obj = &shared({});
406+
$$obj{'foo'} = 'bar';
407+
$$obj{'qux'} = 99;
408+
bless($obj, 'My::Class');
409+
$q->enqueue($obj);
410410
411411
See L</"LIMITATIONS"> for caveats related to passing objects via queues.
412412
@@ -546,18 +546,18 @@ Adds the list of items to the queue at the specified index position (0
546546
is the head of the list). Any existing items at and beyond that position are
547547
pushed back past the newly added items:
548548
549-
$q->enqueue(1, 2, 3, 4);
550-
$q->insert(1, qw/foo bar/);
551-
# Queue now contains: 1, foo, bar, 2, 3, 4
549+
$q->enqueue(1, 2, 3, 4);
550+
$q->insert(1, qw/foo bar/);
551+
# Queue now contains: 1, foo, bar, 2, 3, 4
552552
553553
Specifying an index position greater than the number of items in the queue
554554
just adds the list to the end.
555555
556556
Negative index positions are supported:
557557
558-
$q->enqueue(1, 2, 3, 4);
559-
$q->insert(-2, qw/foo bar/);
560-
# Queue now contains: 1, 2, foo, bar, 3, 4
558+
$q->enqueue(1, 2, 3, 4);
559+
$q->insert(-2, qw/foo bar/);
560+
# Queue now contains: 1, 2, foo, bar, 3, 4
561561
562562
Specifying a negative index position greater than the number of items in the
563563
queue adds the list to the head of the queue.
@@ -575,18 +575,18 @@ called with no arguments, C<extract> operates the same as C<dequeue_nb>.
575575
This method is non-blocking, and will return only as many items as are
576576
available to fulfill the request:
577577
578-
$q->enqueue(1, 2, 3, 4);
579-
my $item = $q->extract(2) # Returns 3
580-
# Queue now contains: 1, 2, 4
581-
my @items = $q->extract(1, 3) # Returns (2, 4)
582-
# Queue now contains: 1
578+
$q->enqueue(1, 2, 3, 4);
579+
my $item = $q->extract(2) # Returns 3
580+
# Queue now contains: 1, 2, 4
581+
my @items = $q->extract(1, 3) # Returns (2, 4)
582+
# Queue now contains: 1
583583
584584
Specifying an index position greater than the number of items in the
585585
queue results in C<undef> or an empty list being returned.
586586
587-
$q->enqueue('foo');
588-
my $nada = $q->extract(3) # Returns undef
589-
my @nada = $q->extract(1, 3) # Returns ()
587+
$q->enqueue('foo');
588+
my $nada = $q->extract(3) # Returns undef
589+
my @nada = $q->extract(1, 3) # Returns ()
590590
591591
Negative index positions are supported. Specifying a negative index position
592592
greater than the number of items in the queue may return items from the head
@@ -598,8 +598,8 @@ greater than zero):
598598
my @nada = $q->extract(-6, 2); # Returns () - (3+(-6)+2) <= 0
599599
my @some = $q->extract(-6, 4); # Returns (foo) - (3+(-6)+4) > 0
600600
# Queue now contains: bar, baz
601-
my @rest = $q->extract(-3, 4); # Returns
602-
# (bar, baz) - (2+(-3)+4) > 0
601+
my @rest = $q->extract(-3, 4); # Returns (bar, baz) -
602+
# (2+(-3)+4) > 0
603603
604604
=back
605605

0 commit comments

Comments
 (0)