Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Opgave41()
- {
- while (true)
- {
- Monitor.Enter(lockThis);
- try
- {
- tal += 2;
- Console.WriteLine(tal);
- Thread.Sleep(1000);
- }
- finally
- {
- Monitor.Exit(lockThis);
- }
- }
- }
- public static void Opgave42()
- {
- while (true)
- {
- Monitor.Enter(lockThis);
- try
- {
- tal--;
- Console.WriteLine(tal);
- Thread.Sleep(1000);
- }
- finally
- {
- Monitor.Exit(lockThis);
- }
- }
- }
Add Comment
Please, Sign In to add comment