File: 03_threads.t

package info (click to toggle)
libcrypt-dh-gmp-perl 0.00012-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 264 kB
  • sloc: perl: 2,093; ansic: 202; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use Test::More;
use Config;
BEGIN {
    if (! $Config{useithreads}) {
        plan skip_all => "This perl is not built with threads";
    }
}
use threads;
use_ok "Crypt::DH::GMP";

my $x = Crypt::DH::GMP->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();