Impl Assumes we are holding the completed sem lock
960438
protected void fireCompletionActions() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "fireCompletionActions");
        }
        if (this.firstListener != null) {
            ICompletionListener listenerToInvoke = this.firstListener;
            // reset listener so it can't be inadvertently be called on the next request
            this.firstListener = null;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "invoking callback for channel id: " + this.channel.channelIdentifier);
            }
            invokeCallback(listenerToInvoke, this, this.firstListenerState);
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "no listener found for event, future: " + this);
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "fireCompletionActions");
        }
    }
850157
protected synchronized void doClose()
    {
        try
        {
            LockManager lm = getImplementation().getLockManager();
            Enumeration en = objectEnvelopeTable.elements();
            while (en.hasMoreElements())
            {
                ObjectEnvelope oe = (ObjectEnvelope) en.nextElement();
                lm.releaseLock(this, oe.getIdentity(), oe.getObject());
            }

            //remove locks for objects which haven't been materialized yet
            for (Iterator it = unmaterializedLocks.iterator(); it.hasNext();)
            {
                lm.releaseLock(this, it.next());
            }

            // this tx is no longer interested in materialization callbacks
            unRegisterFromAllIndirectionHandlers();
            unRegisterFromAllCollectionProxies();
        }
        finally
        {
            /**
             * MBAIRD: Be nice and close the table to release all refs
             */
            if (log.isDebugEnabled())
                log.debug("Close Transaction and release current PB " + broker + " on tx " + this);
            // remove current thread from LocalTxManager
            // to avoid problems for succeeding calls of the same thread
            implementation.getTxManager().deregisterTx(this);
            // now cleanup and prepare for reuse
            refresh();
        }
    }
758758
def handle_typecheck_complete(self, call_id, payload):
        
        self.log.debug('handle_typecheck_complete: in')
        if not self.currently_buffering_typechecks:
            self.log.debug('Completed typecheck was not requested by user, not displaying notes')
            return

        self.editor.display_notes(self.buffered_notes)
        self.currently_buffering_typechecks = False
        self.buffered_notes = []
984713
private void waitUntilReconstitutionIsCompleted()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "waitUntilReconstitutionISCompleted");

        // gracefully shutdown the pool
        _reconstituteThreadpool.shutdown();

        //awaitTermination() is a blocking call and caller thread will be blocked
        //until all tasks in pool have completed execution after a shutdown request
        try
        {
            _reconstituteThreadpool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e)
        {
            // No FFDC code needed
            SibTr.exception(tc, e);
        }

        //Destroy the thread pool
        _reconstituteThreadpool = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "waitUntilReconstitutionISCompleted");
    }
649852
def step_impl(context, max_modified):
    
    assert len(context.buf) == len(context.fuzzed_buf)
    count = number_of_modified_bytes(context.buf, context.fuzzed_buf)
    assert count >= 0
    assert count <= max_modified
303288
def acquire_lock(cls, mode, user=None):
        
        if not user:
            return

        with EteSyncCache.lock:
            cls.user = user

            cls.etesync = cls._get_etesync_for_user(cls.user)

            if cls._should_sync():
                cls._mark_sync()
                cls.etesync.get_or_create_user_info(force_fetch=True)
                cls.etesync.sync_journal_list()
                for journal in cls.etesync.list():
                    cls.etesync.pull_journal(journal.uid)
            yield
            if cls.etesync.journal_list_is_dirty():
                cls.etesync.sync_journal_list()
            for journal in cls.etesync.list():
                if cls.etesync.journal_is_dirty(journal.uid):
                    cls.etesync.sync_journal(journal.uid)

            cls.etesync = None
            cls.user = None
158513
private void completeEnclosing(ClassSymbol c) {
        if (c.owner.kind == PCK) {
            Symbol owner = c.owner;
            for (Name name : Convert.enclosingCandidates(Convert.shortName(c.name))) {
                Symbol encl = owner.members().findFirst(name);
                if (encl == null)
                    encl = syms.getClass(c.packge().modle, TypeSymbol.formFlatName(name, owner));
                if (encl != null)
                    encl.complete();
            }
        }
    }
438623
@Override boolean set_impl(int i, long l) {
    if( _ds   != null ) return set_impl(i,(double)l);
    if(_sparseLen != _len){ // sparse?
      int idx = Arrays.binarySearch(_id,0, _sparseLen,i);
      if(idx >= 0)i = idx;
      else cancel_sparse(); // for now don't bother setting the sparse value
    }
    _ms.set(i,l);
    _xs.set(i,0);
    if(_missing != null)_missing.clear(i);
    _naCnt = -1;
    return true;
  }
1017657
function complete(e) {
    clearTimeout(doneTimeout);
    if (!done) { return; }
    var d = done;
    done = null;
    if (e) {
      // test failure
      if (!(e instanceof Error)) {
        e = new Error(e);
      }
      d(e);
    } else {
      // test passed
      d();
    }
  }
47725
function isTaskLocked(task) {
  if(task.semaphore) {
    if(!task.semaphore.ttl) {
      throw new TypeError('TimeToLiveNotPresent');
    }
    return ( (timestamp() - task.semaphore.time) < task.semaphore.ttl );
  }
  return false;
}
1094745
def step_impl10(context):
    
    assert context.app_list and len(
        context.app_list) > 0, "ENSURE: app list is provided."
    assert context.file_list and len(
        context.file_list) > 0, "ENSURE: file list is provided."
    context.fuzz_executor = FuzzExecutor(context.app_list, context.file_list)
    assert context.fuzz_executor, "VERIFY: fuzz executor created."
1042589
def collect_impl(self):
        

        ldata = self.get_ldata()
        rdata = self.get_rdata()

        for change_type in self.change_types:
            yield change_type(ldata, rdata)
713247
static void acquireAndRelease(Semaphore lock) {
        try {
            lock.acquire();
            lock.release();
        } catch (InterruptedException ex) {
            throw loggedDistributerException(ex, "interruped while waiting for a semaphare");
        }
    }
1267799
def forced_insert(self):
        
        # If we have any tokens we are waiting for
        if self.insert_till:
            # Determine where to append this token
            append_at = -1
            if self.inserted_line:
                append_at = -self.inserted_line+1

            # Reset insert_till if we found it
            if self.current.tokenum == self.insert_till[0] and self.current.value == self.insert_till[1]:
                self.insert_till = None
            else:
                # Adjust self.adjust_indent_at to take into account the new token
                for index, value in enumerate(self.adjust_indent_at):
                    if value < len(self.result) - append_at:
                        self.adjust_indent_at[index] = value + 1

                # Insert the new token
                self.result.insert(append_at, (self.current.tokenum, self.current.value))

            # We appended the token
            return True
1281118
void checkClosed() throws FetchException {
        TransactionScope<Txn> scope = localTransactionScope();

        // Lock out shutdown task.
        scope.getLock().lock();
        try {
            if (mPrimaryDatabase == null) {
                // If shutting down, this will force us to block forever.
                try {
                    scope.getTxn();
                } catch (Exception e) {
                    // Don't care.
                }
                // Okay, not shutting down, so throw exception.
                throw new FetchException("Repository closed");
            }
        } finally {
            scope.getLock().unlock();
        }
    }
1360256
private void lockInodeInternal(Inode inode, LockMode mode) {
    Preconditions.checkState(!endsInInode());
    String lastEdgeName = ((EdgeEntry) lastEntry()).getEdge().getName();
    Preconditions.checkState(inode.getName().equals(lastEdgeName),
        "Expected to lock inode %s but locked inode %s", lastEdgeName, inode.getName());

    mLockedInodes.add(inode);
    mEntries.add(new InodeEntry(mInodeLockManager.lockInode(inode, mode), inode));
  }
1336962
def check_hook_mechanism_is_intact(module):
    
    result = True
    if check_register_present(module):
        result = not result
    if check_deregister_present(module):
        result = not result
    return result