In threads3: renamed the boolean hook field to lock.
In threads4: Renamed SynchronizedListing to SynchronizedStack; made printElements synchronized.
Changes to TimeoutHashtable:
 - made the class generic(template types);
 - added TimeoutElement class for the Hashtable values