多线程中的变量共享
摘要:
1 use threads; 2 use threads::shared; 3 my $count:shared = 1; 4 print "主线程中count为:$count\n"; 5 6 sub thread1{ 7 print "线程1增加1\n"; 8 $count++; 9 print "在线程1中结果为:$coun... 阅读全文
posted @ 2017-02-26 23:34 Perl6 阅读(1130) 评论(0) 推荐(0) 编辑