Threads

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,I have a references list which is part of singletone members.
Another class calls the sigletone.method(refList) and passes a list of
one reference while inside the method (if i print) i see already 2
references in this list.
How comes?
 
csharpula csharp said:
Hello,I have a references list which is part of singletone members.
Another class calls the sigletone.method(refList) and passes a list of
one reference while inside the method (if i print) i see already 2
references in this list.
How comes?

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
In class A:

List nList=new List()
PRef pRef=new pRef("aaa");
nList.Add(pRef)
Console.Writeline(nList.Count)//The result is 1
Beggining of a new thread
singeltoneObj.Instance.MethodA(nList)

Consolw.Writeline (nList.Count)//Inside the sibgletone code the result
2.

How comes?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top