/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1.  

2. class SomeClass 

3.

4.   java.util.Vector  vecref ; 

5.  

6.   //...... 

7.  

8.   void someMethod () 

9.   { 

10.     //..... 

11.     synchronized ( vecref ) 

12.     { 

13.       //  use vecref 

14.       // Vector's synchronized code 

15.       // locked for other threads 

16.     } 

17.     // vector unlocked 

18.     //..... 

19.   } 

20. //..... 

21.