#vulnerable code 
                             @Override
	public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
		long timeoutMillis = unit.toMillis(timeout);
		long endTime       = System.currentTimeMillis() + timeoutMillis;
		synchronized (this) {
			if (ready)              return ready;
			if (timeoutMillis <= 0) return ready;
			waiters++;
			try {
				while (!ready) {
					wait(timeoutMillis);
					if (endTime < System.currentTimeMillis() && !ready) {
						exception = new TimeoutException();
						break;
					}
				}
			} finally {
				waiters--;
			}
		}
		return ready;
	} 
                            #location 21 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             @Override
	public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
		long timeoutMillis = unit.toMillis(timeout);
		long endTime       = System.currentTimeMillis() + timeoutMillis;
		synchronized (this) {
			if (done)               return done;
			if (timeoutMillis <= 0) return done;
			waiters++;
			try {
				while (!done) {
					wait(timeoutMillis);
					if (endTime < System.currentTimeMillis() && !done) {
						exception = new TimeoutException();
						break;
					}
				}
			} finally {
				waiters--;
			}
		}
		return done;
	}