File: 800_threads.t

package info (click to toggle)
libsereal-decoder-perl 4.005%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,952 kB
  • sloc: ansic: 8,105; perl: 5,782; sh: 25; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (3)
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
27
28
29
30
#!perl
use strict;
use warnings;
use Test::More;

BEGIN {
  use Config;
  if (! $Config{'useithreads'}) {
    print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
    exit(0);
  }
  elsif ($] < 5.008007) {
    print("1..0 # SKIP Sereal not thread safe on Perls before 5.8.7\n");
    exit(0);
  }
}

use Sereal::Decoder;
plan tests => 1;
use threads;

sub foo {}
SCOPE: {
  my $enc = Sereal::Decoder->new;

  my $thr = threads->new(\&foo);
  $thr->join;
}

pass();