Link to home
Create AccountLog in
Avatar of RobertFromSecretWeapons
RobertFromSecretWeapons

asked on

Passing Args ByRef into Threadstart Objects

Hi,

I have created a thread and I need to run two instances of it at the same time.  These two threads each need their own ManualResetEvent reference.

These two threads need to use their own MRE.

How do I pass in a reference to each threads MRE into the threadstart constructor.
SOLUTION
Avatar of Hawkvalley1
Hawkvalley1
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of RobertFromSecretWeapons
RobertFromSecretWeapons

ASKER

I think the arguments provided via the threadstarts are byVals and not ByRef's, therefore I don't think I can pass in a reference to each threads ManualResetEvent.

I will have to fallback to the class system approach and pass in the args that way.

There were elements in each of your responses that I found helpful.