private final void copy_check_and_promote( NonBlockingHashMap topmap, Object[] oldkvs, int workdone ) {
      assert chm(oldkvs) == this;
      int oldlen = len(oldkvs);
      // We made a slot unusable and so did some of the needed copy work
      long copyDone = _copyDone;
      assert (copyDone+workdone) <= oldlen;
      if( workdone > 0 ) {
        while( !_copyDoneUpdater.compareAndSet(this,copyDone,copyDone+workdone) ) {
          copyDone = _copyDone; // Reload, retry
          assert (copyDone+workdone) <= oldlen;
        }
      }

      // Check for copy being ALL done, and promote.  Note that we might have
      // nested in-progress copies and manage to finish a nested copy before
      // finishing the top-level copy.  We only promote top-level copies.
      if( copyDone+workdone == oldlen && // Ready to promote this table?
          topmap._kvs == oldkvs &&       // Looking at the top-level table?
          // Attempt to promote
          topmap.CAS_kvs(oldkvs,_newkvs) ) {
        topmap._last_resize_milli = System.currentTimeMillis(); // Record resize time for next check
      }
    }
Put, Remove, PutIfAbsent, etc.  Return the old value.  If the returned value is equal to expVal (or expVal is
{@link #NO_MATCH_OLD}) then the put can be assumed to work (although might have been immediately overwritten).
Only the path through copy_slot passes in an expected value of null, and putIfMatch only returns a null if passed
in an expected null.

@param topmap the map to act on
@param kvs the KV table snapshot we act on
@param key not null (will result in {@link NullPointerException})
@param putval the new value to use. Not null. {@link #TOMBSTONE} will result in deleting the entry.
@param expVal expected old value. Can be null. {@link #NO_MATCH_OLD} for an unconditional put/remove.
             {@link #TOMBSTONE} if we expect old entry to not exist(null/{@link #TOMBSTONE} value).
             {@link #MATCH_ANY} will ignore the current value, but only if an entry exists. A null expVal is used
              internally to perform a strict insert-if-never-been-seen-before operation.
@return {@link #TOMBSTONE} if key does not exist or match has failed. null if expVal is
null AND old value was null. Otherwise the old entry value (not null).
jctools-core/src/main/java/org/jctools/maps/NonBlockingHashMap.java