threads and concurrency timer objectthas the following methodst start(starts the timer the function func supplied to timer(will be executed after the specified timer interval cancel(cancels the timer if the function has not executed yet lock objects primitive lock (or mutual exclusion lockis synchronization primitive that' in either "lockedor "unlockedstate two methodsacquire(and release()are used to change the state of the lock if the state is lockedattempts to acquire the lock are blocked until the lock is released if more than one thread is waiting to acquire the lockonly one is allowed to proceed when the lock is released the order in which waiting threads proceed is undefined new lock instance is created using the following constructorlock(creates new lock object that' initially unlocked lock instancelocksupports the following methodslock acquire([blocking ]acquires the lockblocking until the lock is released if necessary if blocking is supplied and set to falsethe function returns immediately with value of false if the lock could not be acquired or true if locking was successful lock release(releases lock it' an error to call this method when the lock is in an unlocked state or from different thread than the one that originally called acquire(rlock reentrant lock is synchronization primitive that' similar to lock objectbut it can be acquired multiple times by the same thread this allows the thread owning the lock to perform nested acquire(and release(operations in this caseonly the outermost release(operation resets the lock to its unlocked state new rlock object is created using the following constructorrlock(creates new reentrant lock object an rlock objectrlocksupports the following methodsrlock acquire([blocking ]acquires the lockblocking until the lock is released if necessary if no thread owns the lockit' locked and the recursion level is set to if this thread already owns the lockthe recursion level of the lock is increased by one and the function returns immediately lib fl ff