Results 1 to 3 of 3

Thread: A kind of CriticalSection in VB.NET ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    18

    A kind of CriticalSection in VB.NET ?

    Hello everyone, I'm a newbie to vb, is there any data type used to lock resource like CCriticalSection in VC++ ? If no, what's the way to do that ?
    I need help on this issue badly, so plz drop a line if you know, thanks.

  2. #2
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: A kind of CriticalSection in VB.NET ?

    Synclock()

    (If I understand your question correctly...

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2005
    Posts
    18

    Re: A kind of CriticalSection in VB.NET ?

    I have two threads both checking the state of one boolean var, like this:

    In Thread 1: lock
    if (bActive = true) then
    .....do job 1..
    end If
    unlock
    In Thread 2: lock
    if (bActive = true) then
    ......do job 2..
    end If
    unlock

    so I guess synclock is not suitable because it says it just protect some "code" , which means the two pieces of code ( job1 and job2)must be identical (?)
    Last edited by maitung; Dec 15th, 2005 at 08:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width