public void insertTruck(string status) { if (System.Threading.Monitor.TryEnter(obj1, 45000)) { try { truckCtr.createTruck(status); } finally { System.Threading.Monitor.Exit(obj1); } } }