Why don't you read what people tell you :
http://www.amiga.org/forums/showthread.php?t=8046You must not UnLock() any locks you didn't Lock() on your own. And you must not UnLock() any lock currently in use by DOS.
The only allowed sequence is:
lock1 = Lock(dir1)
oldlock = CurrentDir(lock1)
lock2 = Lock(dir2)
CurrentDir(lock2) /* should return lock1 */
UnLock (lock1)
lock3 = Lock(dir3)
CurrentDir(lock3) /* should return lock2 */
UnLock (lock2)
Currentdir (oldlock) /* should return lock3 */
UnLock (lock3)
Bye,
Thomas