ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/04_rwlock.t
Revision: 1.1
Committed: Thu Jul 26 03:46:15 2001 UTC (22 years, 10 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-2_5, rel-2_0, rel-2_1, rel-1_1, rel-1_0, rel-1_9, rel-1_2, rel-1_5, rel-1_4, rel-1_7, rel-1_6, rel-1_31, stack_sharing
Log Message:
*** empty log message ***

File Contents

# Content
1 $|=1;
2 print "1..15\n";
3
4 use Coro;
5 use Coro::RWLock;
6
7 my $l = new Coro::RWLock;
8
9 print "ok 1\n";
10 $l->rdlock;
11 print (($l->tryrdlock ? "" : "not "), "ok 2\n");
12 print (($l->trywrlock ? "not " : ""), "ok 3\n");
13 $l->unlock;
14 $l->unlock;
15 print (($l->trywrlock ? "" : "not "), "ok 4\n");
16 print (($l->trywrlock ? "not " : ""), "ok 5\n");
17 print (($l->tryrdlock ? "not " : ""), "ok 6\n");
18
19 async {
20 print "ok 8\n";
21 $l->wrlock;
22 print "ok 10\n";
23 $l->unlock;
24 $l->rdlock;
25 print "ok 11\n";
26 cede;
27 print "ok 14\n";
28 };
29
30 print "ok 7\n";
31 cede;
32 print "ok 9\n";
33 $l->unlock;
34 cede;
35 print "ok 12\n";
36 $l->rdlock;
37 print "ok 13\n";
38 cede;
39 print "ok 15\n";
40
41
42
43
44
45