The lock key work

  • Thread starter Thread starter Tomer
  • Start date Start date
T

Tomer

Hi,

I want to use the lock key word when I execute a function on another form,
that function performs some
operations on a DataAdapter and a DataTable.

code like this:

lock (xform)
{
xform.method(y);
}

Any known problem doing it , that I should know about?

Tomer.
 
Tomer said:
I want to use the lock key word when I execute a function on another form,
that function performs some
operations on a DataAdapter and a DataTable.

code like this:

lock (xform)
{
xform.method(y);
}

Any known problem doing it , that I should know about?

Well, that really depends on what you're doing with it. You shouldn't
generally be doing things with a form from different threads anyway.
Threading on the Compact Framework isn't *hugely* different from the
main framework - see
http://www.pobox.com/~skeet/csharp/threads
 
Back
Top