argra****@users*****
argra****@users*****
2012年 12月 18日 (火) 16:44:28 JST
Index: docs/modules/threads-shared-1.14/threads/shared.pod diff -u docs/modules/threads-shared-1.14/threads/shared.pod:1.3 docs/modules/threads-shared-1.14/threads/shared.pod:1.4 --- docs/modules/threads-shared-1.14/threads/shared.pod:1.3 Thu May 26 01:47:06 2011 +++ docs/modules/threads-shared-1.14/threads/shared.pod Tue Dec 18 16:44:28 2012 @@ -155,11 +155,11 @@ =end original -C<share> will traverse up references exactly I<one> level. C<share(\$a)> is -equivalent to C<share($a)>, while C<share(\\$a)> is not. This means that you -must create nested shared data structures by first creating individual shared -leaf nodes, and then adding them to a shared hash or array. -(TBT) +C<share> はリファレンスを正確に I<1> レベルだけ調べます。 +C<share(\$a)> は C<share($a)> と等価ですが、C<share(\\$a)> は違います。 +これは、ネストした共有データ構造は、まずそれぞれの共有葉オブジェクトを作成し、 +それからそれらを共有ハッシュやアレイに追加することによって +作成しなければならないことを意味します。 my %hash :shared; $hash{'meaning'} = &share([]); @@ -176,10 +176,10 @@ =end original -C<is_shared> checks if the specified variable is shared or not. If shared, -returns the variable's internal ID (similar to -L<refaddr()|Scalar::Util/"refaddr EXPR">). Otherwise, returns C<undef>. -(TBT) +C<is_shared> は、指定された変数が共有されているかどうかをチェックします。 +共有されていれば、(L<refaddr()|Scalar::Util/"refaddr EXPR"> と同様に) 変数の +内部 ID を返します。 +そうでなければ、C<undef> を返します。 if (is_shared($var)) { print("\$var is shared\n"); @@ -451,9 +451,9 @@ =end original -L<threads::shared> exports a version of L<bless()|perlfunc/"bless REF"> that -works on shared objects such that I<blessings> propagate across threads. -(TBT) +L<threads::shared> I<bless> がスレッドをまたいで伝搬するような +共有オブジェクトで動作するバージョンの L<bless()|perlfunc/"bless REF"> を +エクスポートします。 # Create a shared 'foo' object my $foo;