Forums: Help (Thread #6196)

「次のキューを取得」マクロの質問 (2004-10-17 02:14 by hamayan #11545)

お世話になっています。
イベントフラグのTA_WMULの動作がどうしてもおかしいので、ソースコードを眺めていて、mknl.hのマクロでよく判らない所が出てきました。

205行目辺りの
#define mknl_ref_nxt(que, mtcb) \
((mtcb)->next != (que)->head ? (que)->head : NULL) /* 次のキューを取得 */
ですが、キューの次のコンテキストを探しているのに、見つかった時は、またキューの先頭のコンテキストを答えています。

これを、以下の様に直すと、思った通りの動作をします。
#define mknl_ref_nxt(que, mtcb) \
((mtcb)->next != (que)->head ? (mtcb)->next : NULL) /* 次のキューを取得 */

対策としては、これで宜しいでしょうか?。

Reply to #11545×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 「次のキューを取得」マクロの質問 (2004-10-17 08:18 by m-arai #11549)

その修正で問題無いと思います。

これじゃぁWMULは正しく動きませんね。いつぞやは、
TA_WMULの'存在だけ'を指摘してしまいましたが、
バグがあったとは。
Reply to #11545

Reply to #11549×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 「次のキューを取得」マクロの質問 (2004-10-18 22:30 by m-arai #11565)

Reply to #11565×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login