private void setAcquired ( HLock lock , Map < String , String > canBeEarlier ) { // start the heartbeat Future < Void > heartbeat = scheduler . schedule ( new Heartbeat ( lock ) , lockTtl / 2 , TimeUnit . MILLISECONDS ) ; ( ( HLockImpl ) lock ) . setHeartbeat ( heartbeat ) ; ( ( HLockImpl ) lock ) . setAcquired ( true ) ; if ( logger . isDebugEnabled ( ) ) { logLock ( lock , canBeEarlier . keySet ( ) ) ; } }
Start the heartbeat thread before we return