summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2024-01-20 23:36:05 +0100
committergregor herrmann <gregoa@debian.org>2024-01-20 23:36:05 +0100
commite7fdc17f581c14646b69e11a948cd51d294d9b0a (patch)
tree169797c945d78f2e8916e4265571546a0beb1806
parent6887e9e037b1bc2107def4f1338782168374100a (diff)
parent9040997189a0b77ca880c1283a71a664ec1e64b1 (diff)
Update upstream source from tag 'upstream/0.52'
Update to upstream version '0.52' with Debian dir ea0c6d09b3b341ad154dd731b95eb653a33c7b95
-rw-r--r--.editorconfig4
-rw-r--r--Build.PL1
-rw-r--r--Changes5
-rw-r--r--LICENSE6
-rw-r--r--MANIFEST1
-rw-r--r--META.json6
-rw-r--r--META.yml6
-rw-r--r--lib/Future/Queue.pm6
-rw-r--r--t/02max-items.t15
9 files changed, 38 insertions, 12 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..24b6e3b
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,4 @@
+root = true
+
+[*.{pm,pl,t}]
+indent_size = 3
diff --git a/Build.PL b/Build.PL
index 125709c..209aff7 100644
--- a/Build.PL
+++ b/Build.PL
@@ -1,3 +1,4 @@
+use v5;
use strict;
use warnings;
diff --git a/Changes b/Changes
index dfde155..fabbb38 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
Revision history for Future-Queue
+0.52 2024-01-03
+ [BUGFIXES]
+ * Avoid an infinite deep recursion on `_manage_push_waiters`
+ (RT151010)
+
0.51 2023-02-08
[CHANGES]
* Allow specifying a different class, prototype instance, or
diff --git a/LICENSE b/LICENSE
index 2404a71..cdc3d32 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-This software is copyright (c) 2023 by Paul Evans <leonerd@leonerd.org.uk>.
+This software is copyright (c) 2024 by Paul Evans <leonerd@leonerd.org.uk>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2023 by Paul Evans <leonerd@leonerd.org.uk>.
+This software is Copyright (c) 2024 by Paul Evans <leonerd@leonerd.org.uk>.
This is free software, licensed under:
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2023 by Paul Evans <leonerd@leonerd.org.uk>.
+This software is Copyright (c) 2024 by Paul Evans <leonerd@leonerd.org.uk>.
This is free software, licensed under:
diff --git a/MANIFEST b/MANIFEST
index 08dd853..3c626d0 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,3 +1,4 @@
+.editorconfig
Build.PL
Changes
lib/Future/Queue.pm
diff --git a/META.json b/META.json
index 2dbefbd..af7094d 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
"Paul Evans <leonerd@leonerd.org.uk>"
],
"dynamic_config" : 1,
- "generated_by" : "Module::Build version 0.4231",
+ "generated_by" : "Module::Build version 0.4234",
"license" : [
"perl_5"
],
@@ -34,7 +34,7 @@
"provides" : {
"Future::Queue" : {
"file" : "lib/Future/Queue.pm",
- "version" : "0.51"
+ "version" : "0.52"
}
},
"release_status" : "stable",
@@ -43,6 +43,6 @@
"http://dev.perl.org/licenses/"
]
},
- "version" : "0.51",
+ "version" : "0.52",
"x_serialization_backend" : "JSON::PP version 4.07"
}
diff --git a/META.yml b/META.yml
index 70f3084..e317a54 100644
--- a/META.yml
+++ b/META.yml
@@ -7,7 +7,7 @@ build_requires:
configure_requires:
Module::Build: '0.4004'
dynamic_config: 1
-generated_by: 'Module::Build version 0.4231, CPAN::Meta::Converter version 2.150010'
+generated_by: 'Module::Build version 0.4234, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -16,11 +16,11 @@ name: Future-Queue
provides:
Future::Queue:
file: lib/Future/Queue.pm
- version: '0.51'
+ version: '0.52'
requires:
Future: '0'
perl: '5.014'
resources:
license: http://dev.perl.org/licenses/
-version: '0.51'
+version: '0.52'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/lib/Future/Queue.pm b/lib/Future/Queue.pm
index c0e8cdc..fbc6fbe 100644
--- a/lib/Future/Queue.pm
+++ b/lib/Future/Queue.pm
@@ -1,9 +1,9 @@
# You may distribute under the terms of either the GNU General Public License
# or the Artistic License (the same terms as Perl itself)
#
-# (C) Paul Evans, 2019-2023 -- leonerd@leonerd.org.uk
+# (C) Paul Evans, 2019-2024 -- leonerd@leonerd.org.uk
-package Future::Queue 0.51;
+package Future::Queue 0.52;
use v5.14;
use warnings;
@@ -165,7 +165,7 @@ sub push :method
push @{ $self->{push_waiters} //= [] }, sub {
my $count = $max - @$items;
push @$items, splice @more, 0, $count;
- $self->_manage_push_waiters;
+ $self->_manage_shift_waiters;
return 0 if @more;
diff --git a/t/02max-items.t b/t/02max-items.t
index d590fd1..efe41e7 100644
--- a/t/02max-items.t
+++ b/t/02max-items.t
@@ -22,4 +22,19 @@ use Future::Queue;
ok( $push_f->is_done, 'push future now done after shift' );
}
+# RT151010
+{
+ my $queue = Future::Queue->new( max_items => 5 );
+
+ my @pushf = map { $queue->push( $_ ) } 'a' .. 'q';
+
+ # Should not spinlock in deep recursion
+ my @shiftf = map { $queue->shift_atmost( 2 ) } 1 .. 9;
+
+ is( [ map { $_->state } @pushf ], [ ("done") x 17 ],
+ 'all push futures completed' );
+ is( [ map { $_->state } @shiftf ], [ ("done") x 9 ],
+ 'all shift futures completed' );
+}
+
done_testing;