Hello,
We have been experiencing a problem with AutoResentEvent class for past
2-3 months. It seems that it just stops at WaitOne and the thread
doesn't released from blocking state. We have been using the following
code for past 4 years, and It was working perfectly fine till Nov-Dec
last year. I suspect a security update had messed it up. Please have a
look at the following code.
[Please note that we are using .NET Framework 1.1 SP1 for development]
-----------------------------------
Thread 1:
--------
public void IRCSendQueue(Xm lDocument doc, string ircdest,bool
bExpectAck)
{
lock(queueIRCSe nd)
{
queueIRCSend.En queue(new IRCSendStruct(d oc,ircdest,bExp ectAck));
}
ircSendSignal.S et();
}
Thread 2:
--------
protected void IRCSendingThrea d()
{
//Event Processing
IRCSendStruct ircSendStruct;
try
{
while(ircclient .Connected)
{
ircSendSignal.W aitOne();
while(queueIRCS end.Count 0)
{
lock(queueIRCSe nd)
{
ircSendStruct = (IRCSendStruct) queueIRCSend.De queue();
}
//Process IRC Message
this.IRCSend((i rcSendStruct.ex pectAck)?ircSen dStruct.doc.Doc umentElement
..SelectSingleN ode(Nodes.SEQNU M).InnerText:nu ll,
Utility.DecodeX ml(ircSendStruc t.doc),ircSendS truct.ircdest);
}
}
}
catch(ThreadAbo rtException)
{
Log("IRC Sending Thread: Thread Abort", LogEntryType.IN FORMATION,
null);
}
}
-----------------------------------
I put in logging before and after Set and WaitOne, It Sets the
AutoResetEvent but WaitOne never returns.
Thanks in advance.
Regards,
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
*** Sent via Developersdex http://www.developersdex.com ***