This is a multi-part message in MIME format.

------extPart_000_0029_01C9E5F7.11AC5800
Content-Type: text/plain;
	charsets-ascii"
Content-Transfer-Encoding: 7bit

Hello,

 

In the Ruby1.9, I found the following function in thread.c file:

 

static void

thread_reset_event_flags(rb_thread_t *th)

{

    rb_event_hook_t *hook  h->event_hooks;

    rb_event_flag_t flag  h->event_flags & RUBY_EVENT_VM;

 

    while (hook) {

        flag | ook->flag; // problem[1]

        hook  ook->next;

    }

}

 

In the line [1] the value of flag is assigned to a local variable. But never
set back to th->event_flags.

Thus the value of th->event_flags before and after line [1] is never
changed. 

 

This is a bug?

 

Thanks and

Best regards,

Tetsu

 


------extPart_000_0029_01C9E5F7.11AC5800
Content-Type: text/html;
	charsets-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"MS Gothic";
	panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
	{font-family:"MS Gothic";
	panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
	{font-family:"MS Gothic";
	panose-1:2 11 6 9 7 2 5 8 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0mm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:"Arial","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Arial","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
 /* Page Definitions */
 @page Section1
	{size:612.0pt 792.0pt;
	margin:99.25pt 30.0mm 30.0mm 30.0mm;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026">
  <v:textbox inset="5.85pt,.7pt,5.85pt,.7pt" />
 </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=JA link=blue vlink=purple style='text-justify-trim:punctuation'>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>Hello,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>In the Ruby1.9, I
found the following function in thread.c file:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>static void<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>thread_reset_event_flags(rb_thread_t *th)<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>{<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>&nbsp;&nbsp;&nbsp; rb_event_hook_t *hook =
th-&gt;event_hooks;<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>&nbsp;&nbsp;&nbsp; rb_event_flag_t flag =
th-&gt;event_flags &amp; RUBY_EVENT_VM;<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>&nbsp;&nbsp;&nbsp; while (hook) {<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
flag |= hook-&gt;flag; // problem[1]<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hook = hook-&gt;next;<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:10.5pt;mso-para-margin-left:1.0gd'><span
lang=EN-US style='font-size:10.0pt'>}<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>In the line [1]
the value of flag is assigned to a local variable. But never set back to
th-&gt;event_flags.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>Thus the value of
th-&gt;event_flags before and after line [1] is never changed. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>This is a bug?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>Thanks and<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>Best regards,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>Tetsu<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>

------extPart_000_0029_01C9E5F7.11AC5800--