File: 03_threads.t

package info (click to toggle)
libfile-mmagic-xs-perl 0.09008-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 484 kB
  • sloc: perl: 2,130; ansic: 1,858; makefile: 9; xml: 1
file content (20 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;
use Test::More;
use Test::Requires 'threads';
use_ok "File::MMagic::XS";

my $x = File::MMagic::XS->new; 
my @threads;
for (1..5) {
    push @threads, threads->create(sub{
        note( "spawned thread : " . threads->tid() );
    });
}

foreach my $thr (@threads) {
    note( "joining thread : " . $thr->tid );
    $thr->join;
}

ok(1);
done_testing();