File perl-Thread-Queue.spec of Package perl-Thread-Queue

# spec file for package perl-Thread-Queue
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           perl-Thread-Queue
Version:        3.12
Release:        0
%define cpan_name Thread-Queue
Summary:        Thread-safe queues
License:        Artistic-1.0 or GPL-1.0+
Group:          Development/Libraries/Perl
Source1:        cpanspec.yml
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(threads::shared) >= 1.21
Requires:       perl(threads::shared) >= 1.21

This module provides thread-safe FIFO queues that can be accessed safely by
any number of threads.

Any data types supported by threads::shared can be passed via queues:

* Ordinary scalars

* Array refs

* Hash refs

* Scalar refs

* Objects based on the above

Ordinary scalars are added to queues as they are.

If not already thread-shared, the other complex data types will be cloned
(recursively, if needed, and including any 'bless'ings and read-only
settings) into thread-shared structures before being placed onto a queue.

For example, the following would cause Thread::Queue to create a empty,
shared array reference via '&shared([])', copy the elements 'foo', 'bar'
and 'baz' from '@ary' into it, and then place that shared reference onto
the queue:

 my @ary = qw/foo bar baz/;

However, for the following, the items are already shared, so their
references are added directly to the queue, and no cloning takes place:

 my @ary :shared = qw/foo bar baz/;

 my $obj = &shared({});
 $$obj{'foo'} = 'bar';
 $$obj{'qux'} = 99;
 bless($obj, 'My::Class');

See "LIMITATIONS" for caveats related to passing objects via queues.

%setup -q -n %{cpan_name}-%{version}

%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}

%{__make} test


%files -f %{name}.files
%doc Changes examples README