Commit | Line | Data |
---|---|---|
0a7dbd1b | 1 | use strict; |
2 | use warnings; | |
3 | ||
0a7dbd1b | 4 | use Test::More 'tests' => 4; |
5 | ||
6 | use Thread::Semaphore; | |
7 | ||
8 | my $s = Thread::Semaphore->new(); | |
9 | is($$s, 1, 'Non-threaded semaphore'); | |
10 | $s->down(); | |
11 | is($$s, 0, 'Non-threaded semaphore'); | |
12 | $s->up(2); | |
13 | is($$s, 2, 'Non-threaded semaphore'); | |
14 | $s->down(); | |
15 | is($$s, 1, 'Non-threaded semaphore'); | |
16 | ||
1090e072 | 17 | exit(0); |
18 | ||
0a7dbd1b | 19 | # EOF |