Question: suppose I have xml inside an html document like

```
<html>
  <body>
     <xml>
        <foo>
          <bar />
          <baz />
        </foo>
     </xml>
   </body>
 </html>

```

What is the best way to apply xslt to the xml node?

Answer: 
Actually someone may call `TestAndSet(&m_s, 1)` i.e. `Leave()` from another thread just after `TestAndSet(&m_s, 0)` and before `if` test in `Enter()`. That way lock will not be obtained and `m_s` will not be equal to `0`. Therefore such check is needed.
None of these examples are neccessarily correct on hardware that has less strict ordering. PowerPC and IA64 are two such examples, and isync and .acq operations are required on the test and set operations that get the lock (similarily lwsync and .rel operations in the exit).