0
Answer

Synchronizing two different objects

Ask a question
Oren Kl

Oren Kl

18y
1.7k
1
Hi, I have a problem in my program where I got two different object (from different classes) using the same resource. One of the objects recreates a file every x seconds, while the second object is reading the file when it is called by the user. When the file reading occurs during the file creation, I get an exception. How do I use the Lock mechanizem (or any other option) to give this resourcse an exslusive access? Thanks, Oren.