Re: c# Thread problem
- From: "Christof Nordiek" <cn@xxxxxxxxx>
- Date: Wed, 4 Jul 2007 14:15:37 +0200
<cty0000@xxxxxxxxx> schrieb im Newsbeitrag
news:1183545253.022824.26220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 7 4 , 6 31 , "Jon Skeet [C# MVP]" <s...@xxxxxxxxx> wrote:
On Jul 4, 10:27 am, cty0...@xxxxxxxxx wrote:
while (true)The following line should be outside of the lock block. The lock should only
{
Thread.Sleep(100);
lock (queueLock)
{
while (GuiMsgQueue.Count == 0)
Monitor.Wait(queueLock);
gMsg = GuiMsgQueue.Dequeue();
spawn the deqeueing, not what is done with the deqeued object after.
update(gMsg);
}
}
}
I'm not sure, if this causes the deadlock. Since deadlocks can only occur
with atleast two lock-objects, there must something else go on. Maybe the
call on update blocks, waiting for the Mainthread, while this is trying to
achieve a lock on qeueLock. This would produce a deadlock.
Christof
.
- Follow-Ups:
- Re: c# Thread problem
- From: Jon Skeet [C# MVP]
- Re: c# Thread problem
- References:
- c# Thread problem
- From: cty0000
- Re: c# Thread problem
- From: Jon Skeet [C# MVP]
- Re: c# Thread problem
- From: cty0000
- c# Thread problem
- Prev by Date: Re: Problems with DllImport and a Delphi native DLL.
- Next by Date: Re: c# Thread problem
- Previous by thread: Re: c# Thread problem
- Next by thread: Re: c# Thread problem
- Index(es):
Relevant Pages
|