I'm creating an app, where I have 50x50 map. On this map I can add dots, which are new instances of the class "dot". Every dot has it's own thread, and every thread connected with a specific dot operates on the method "explore" of the class, and in this method there is another method "check\_place(x,y)" which is responsible for checking if some place on the map was already discovered. If not, the static variable of the class "num\_discovered" should be incremented. This single instance of the method "check\_place(x,y)" should be accessed in the real-time by every thread started in the app.

Constructor:

```
public dot(Form1 F)
{    
    /...
    thread = new System.Threading.Thread(new System.Threading.ThreadStart(explore)); //wątek wykonujący metodę explore klasy robot
    thread.Start();
}

```

check\_place(x,y) method:

```
static void check_place(int x, int y)
{
    lock (ob)
    {
        if (discovered[x, y] == false)
        {
            discovered[x, y] = true;
            num_discovered += 1;
        }
    }
}

```

In the explore method I'm invoking method "check\_place(x,y)" like this:

```
dot.check_place(x, y);

```

Is it enough to achieve a situation where in the single time only one dot can check if place was already discovered?