public void bind ( boolean wholeCore ) { if ( bound && assignedThread != null && assignedThread . isAlive ( ) ) throw new IllegalStateException ( "cpu " + cpuId + " already bound to " + assignedThread ) ; if ( areAssertionsEnabled ( ) ) boundHere = new Throwable ( "Bound here" ) ; if ( wholeCore ) { lockInventory . bindWholeCore ( cpuId ) ; } else if ( cpuId >= 0 ) { bound = true ; assignedThread = Thread . currentThread ( ) ; LOGGER . info ( "Assigning cpu {} to {}" , cpuId , assignedThread ) ; } if ( cpuId >= 0 ) { BitSet affinity = new BitSet ( ) ; affinity . set ( cpuId , true ) ; Affinity . setAffinity ( affinity ) ; } }
Bind the current thread to this reservable lock .