Dispatch a single callback in the current thread.

        :param boolean block: If True, blocks waiting for a callback to come.
        :return: True if a callback was processed; otherwise False.
6791
def process_callback(self, block=True):
        
        try:
            (callback, args) = self._queue.get(block=block)
            try:
                callback(*args)
            finally:
                self._queue.task_done()
        except queue.Empty:
            return False
        return True
1131265
public boolean lock(boolean shared, boolean block)
  {
    if (shared && !_canRead) {
      // Invalid request for a shared "read" lock on a write only stream.

      return false;
    }

    if (!shared && !_canWrite) {
      // Invalid request for an exclusive "write" lock on a read only stream.

      return false;
    }

    return true;
  }
354162
def on_success(&block)
      on do |_, value, reason|
        block.call(value) unless reason
      end
    end
230199
def call(self, *args, **kwargs):
        
        args, kwargs = self.__process__(*args, **kwargs)
        return check_call(args, **kwargs)
783454
function( name, block ) {
		var self = this, passed = true;

		try {
			block();
		}
		catch ( e ) {
			passed = false;
		}

		return self.ok( name, passed, self.doesNotThrow, 'Block does throw error' );
	}
797676
private boolean beginBlocking() {
    begin();
    synchronized (blockingThreads) {
      if (isOpen()) {
        blockingThreads.add(Thread.currentThread());
        return true;
      }

      return false;
    }
  }
1080173
def block(self):
        

        self._nosig = True
        yield
        self._nosig = False
        if self._interrupted:
            raise SystemExit("Aborted...")
446864
def run_callbacks(action_name, &block)
      filter_callbacks(:before, action_name).each { |hook| send hook[:callback] }
      yield if block_given?
      filter_callbacks(:after, action_name).each { |hook| send hook[:callback] }
    end
42715
private CallbackResult<Boolean> renderBlock(BufferBuilder buffer, IBlockAccess world, BlockPos pos, IBlockState state)
	{
		IBlockRenderer renderer = getBlockRendererOverride(world, pos, state);
		if (renderer == null)
			renderer = blockRenderers.get(state.getBlock());
		if (renderer == null)
			return CallbackResult.noResult();

		//convert pos to immutable one
		return CallbackResult	.<Boolean> builder()
								.value(renderer.renderBlock(buffer, world, new BlockPos(pos), state))
								.withReturn(true)
								.result();
	}
678015
def execute(receiver, method, args, block)
      @mutex.synchronize do
        raise "already calling" if @call
        @call = Call::Sync.new(self, method, args, block)
      end

      receiver << @call
    end
757615
@SideOnly(Side.CLIENT)
	public static void onRenderBlock(IRenderBlockCallback callback, CallbackOption<IRenderBlockCallbackPredicate> option)
	{
		renderBlockRegistry.registerCallback(callback, option);
	}
60182
def __mock_dispatch_call context, disp, actual_args, actual_block, &_yield
      args = if disp.peek_args
               __mock_block_call(context, disp.peek_args,
                                 actual_args, actual_block, true)
             else
               actual_args
             end

      ret = if disp.returns
              __mock_block_call(context, disp.returns,
                                args, actual_block, true)
            elsif disp.original_method # proxies for singleton methods
              context.__send__(disp.original_method, *args, &actual_block)
            else # proxies for instance methods
              # need the original context for calling `super`
              # ruby: can't pass a block to yield, so we name it _yield
              _yield.call(args, &actual_block)
            end

      if disp.peek_return
        __mock_block_call(context, disp.peek_return, ret, EmptyBlock, false)
      else
        ret
      end
    end
120151
def trigger(self, source, actions, event_args):
		
		type = BlockType.TRIGGER
		return self.action_block(source, actions, type, event_args=event_args)
166486
def block(self, *args, **kwargs):
        
        LOG.debug(
            '%s on %s (awaitable %s async %s provider %s)',
            'blocking',
            self._func,
            self._is_awaitable,
            self._is_asyncio_provider,
            self._concurrency_provider
        )

        if self._deferable:
            raise RuntimeError('Already activated this call by deferring it')
        with self._lock:
            if not hasattr(self, '_result'):
                try:
                    self._result = (
                        self._concurrency_provider.run_until_complete(self.defer(*args, **kwargs))
                        if self._is_asyncio_provider else self._func(*args, **kwargs)
                    )
                except queue.Empty:
                    raise CloudTimeoutError("No data received after %.1f seconds." % kwargs.get("timeout", 0))
            self._blocked = True
        return self._result
791519
def _fetchBlock(self):
        
        # make sure that another block request is not standing
        if self._blockRequestInProgress :
           # need to wait here before returning... (TODO)
           return

        # make sure another block request has not completed meanwhile
        if self._standbyBlock is not None: 
           return

        self._blockRequestInProgress = True
        fetchReq = TFetchResultsReq(operationHandle=self.operationHandle,
                                    orientation=TFetchOrientation.FETCH_NEXT,
                                    maxRows=self.arraysize)
        self._standbyBlock = self._fetch([],fetchReq)
        self._blockRequestInProgress = False
        return
767455
protected boolean dispatch(TCPBaseRequestContext req, IOException ioe) {

        if (req.blockedThread) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "dispatcher notifying waiting synch request ");
            }
            if (ioe != null) {
                req.blockingIOError = ioe;
            }
            req.blockWait.simpleNotify();
            return true;
        }
        // dispatch the async work
        return dispatchWorker(new Worker(req, ioe));
    }
464369
private void runSubmissions(boolean block) throws InterruptedException {
        if (block) {
            Runnable r = m_submissionQueue.take();
            do {
                r.run();
            } while ((r = m_submissionQueue.poll()) != null);
        } else {
            Runnable r = null;
            while ((r = m_submissionQueue.poll()) != null) {
                r.run();
            }
        }
    }