Re: Subroutine lock doesn't work for me. Please help



Hi Kevin Sproule,
Thanks for replying, and yes, adding the variable does help. Can I ask
you a few more questions or whoever:

1. Why the need to add the $lock variable since doesn't the subroutine
already have a lock attribute? (and since section on subroutine lock
didn't mention it.)

2. The output is " A thread exited while 2 threads were running.".
What other 2 threads are there?

3. I didn't understand your comment about "Don't join the main thread
or ourselves ". I understand the main thread part, but aren't we
suppose to join ourselves once the exeuction is done?

Thank you. I am still learning about threads.
jiac.

.



Relevant Pages

  • Re: Filibustering
    ... >>>You implied it when replying to a thread where I had stated I wanted ... >>You might have forgotten to lock it. ... Alex Heney, Global Villager ...
    (uk.legal)
  • Re: Filibustering
    ... >>You implied it when replying to a thread where I had stated I wanted ... >You might have forgotten to lock it. ... >Or (if he is your daughters boyfriend) she might have lent him a key. ...
    (uk.legal)
  • Re: Green Light
    ... Whoever was smart enough to lock up Ronnie Brown in keeper leagues just ...
    (alt.sports.football.pro.phila-eagles)
  • Re: Thread Locking In Static Methods - How?
    ... > public static void LogText ... > lock ) ... Both lockand lock) are a bad idea, IMO. ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Thread Locking In Static Methods - How?
    ... >> public static void LogText ... >> lock ) ... > Both lockand lock) are a bad idea, IMO. ... > If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)

Loading