"Colette_J" <papow (AT) yahoo (DOT) com> wrote
Quote:
Not sure if this is the best group for the posting, but hopefully someone
can point me in the right direction. I'm firing a thread which populates
a hash table of objects, can I at any point suspend the thread and
traverse (work) the hash table for an object and then continue the thread
once complete with my traversal?
Colette
Hi,
|
I think you can try this :
private void ThreadProc()
{
while (...)
{
lock(m_HashTable)
{
m_HashTable.add(...);
}
}
}
private void OtherMethod(...)
{
lock(m_HashTable)
{
' While m_HashTable is locked, the thread will be blocked
' and will continue as soon as you release the lock
}
}
I hope it helps
ThunderMusic