On Wed, Jan 18, 2012 at 07:50:19PM +0000, Peter Maydell wrote: > On 18 January 2012 19:43, James Greensky <gsk...@gmail.com> wrote: > > On Tue, Jan 17, 2012 at 7:03 PM, 陳韋任 <che...@iis.sinica.edu.tw> wrote: > >> I think those numbers (0, 1, and 2) means tb_add_jump 2nd parameter here, > >> so > >> it's intentionally to check jmp_first when n is 2. Since tb->jmp_first is > >> never > >> to be zero, then condition is always false (do nothing) when n is 2. > > > Chenwj, you are correct, the check bypasses the whole function, I was > > not paying enough attention to that check, it should never be null, in > > which case the code doesn't get executed and the chaining remains > > unchanged. > > The question that occurs to me is, is this working like this by design, > or is it a bug that just happens to have no ill effects? The fact that > the condition in tb_add_jump() is commented as "only needed for thread > safety" suggests the latter to me...
`git blame` shows Fabrice wrote that comment, so maybe only he knows the real reason. Is the "thread" in the comment the same as in multi-thread? Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj