File: 800_threads.t

package info (click to toggle)
libsereal-decoder-perl 5.004%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,556 kB
  • sloc: ansic: 11,615; perl: 6,938; sh: 25; makefile: 9
file content (30 lines) | stat: -rw-r--r-- 508 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();