☆─────────────────────────────────────☆
chgdragon (cplusmad) 于 (Thu Apr 5 20:57:16 2007) 提到:
Implement a lock object in Java that takes thread priority into
consideration.
Assume that all threads in the system are subclasses
of MyThread. We want to define a Lock class so that
other parts of the program can use this class to
protect critical sections:
Lock lock;
....
lock.lock();
.... // synchronized code
lock.unlock();
The special requirement for Lock is that, regardles