Well without knowing all the code behind Processor or the listener or getStateLock I can say that this appears to be checking for the state of the processor object and monitors the object until it is available and gets a lock.
This function appears to check the state of the object and if it is not in the state specified, it keeps checking until it is. This function then returns true if the object is now in the specified state or false if there was an error.
Since this appears to be dealing with synchronization it is to be assumed that it is waiting for the object to be free of a lock so that another thread can get access to it.
If you are unfamiliar with locks, threads at times may attempt to use the same object at the same time. To prevent this a thread can place a lock on the object which makes all other threads wait to use it. After it is done with the object, it removes the lock and thus allows waiting threads to have access.
But other than that, no one can be sure without seeing the other functions and the Processor object.
This post has been edited by Martyr2: 3 Aug, 2008 - 09:37 PM