Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現在、食事の哲学者の問題を実装しようとしていますが、問題が発生しています。私は自分のフォークをそのように宣言します
public static fixed Monitor forks[5];
ただし、それらを参照しようとすると
forks[i].Enter();
「Equals、GetType、ToString、GetHashCode」の可能性しか与えられていません。
モニターの配列を作成し、特定の各モニターをロックする方法を知っている人はいますか?