int Executor::renameFile(
    const char* oldPath,
    const char* newPath)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->renameFile(oldPath, newPath);
}
int Executor::challengeLocal(
    const char* user,
    char challengeFilePath[EXECUTOR_BUFFER_SIZE])
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->challengeLocal(user, challengeFilePath);
}
int Executor::authenticatePassword(
    const char* username,
    const char* password)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->authenticatePassword(username, password);
}
FILE* Executor::openFile(
    const char* path,
    int mode)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->openFile(path, mode);
}
int Executor::authenticateLocal(
    const char* challengeFilePath,
    const char* response)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->authenticateLocal(challengeFilePath, response);
}
Beispiel #6
0
Mutex::Mutex()
{
    once(&_once, _init_attr);
    pthread_mutex_init(&_rep.mutex, &_attr);
#if defined(PEGASUS_DEBUG)
    _rep.count = 0;
#endif
}
Beispiel #7
0
static struct VP8D_COMP *create_decompressor(VP8D_CONFIG *oxcf) {
  VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP));

  if (!pbi) return NULL;

  memset(pbi, 0, sizeof(VP8D_COMP));

  if (setjmp(pbi->common.error.jmp)) {
    pbi->common.error.setjmp = 0;
    remove_decompressor(pbi);
    return 0;
  }

  pbi->common.error.setjmp = 1;

  vp8_create_common(&pbi->common);

  pbi->common.current_video_frame = 0;
  pbi->ready_for_new_data = 1;

  /* vp8cx_init_de_quantizer() is first called here. Add check in
   * frame_init_dequantizer() to avoid
   *  unnecessary calling of vp8cx_init_de_quantizer() for every frame.
   */
  vp8cx_init_de_quantizer(pbi);

  vp8_loop_filter_init(&pbi->common);

  pbi->common.error.setjmp = 0;

#if CONFIG_ERROR_CONCEALMENT
  pbi->ec_enabled = oxcf->error_concealment;
  pbi->overlaps = NULL;
#else
  (void)oxcf;
  pbi->ec_enabled = 0;
#endif
  /* Error concealment is activated after a key frame has been
   * decoded without errors when error concealment is enabled.
   */
  pbi->ec_active = 0;

  pbi->decoded_key_frame = 0;

  /* Independent partitions is activated when a frame updates the
   * token probability table to have equal probabilities over the
   * PREV_COEF context.
   */
  pbi->independent_partitions = 0;

  vp8_setup_block_dptrs(&pbi->mb);

  once(initialize_dec);

  return pbi;
}
int Executor::startProviderAgent(
    const char* module,
    const String& pegasusHome,
    const String& userName,
    int& pid,
    AnonymousPipe*& readPipe,
    AnonymousPipe*& writePipe)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->startProviderAgent(
        module, pegasusHome, userName, pid, readPipe, writePipe);
}
Beispiel #9
0
int emu_lods(unsigned char *lina)
{
    unsigned char *orig_lina = lina;
    int err;

    if (opa.repe || opa.repne)
	err = repeat(&lina, &emu_s_lods, &emu_e_lods);
    else
	err = once(&lina, &emu_s_lods, &emu_e_lods);
    if (!err)
	REG(eip) += lina-orig_lina;
    return err;
}
Beispiel #10
0
int emu_outs(unsigned char *lina)
{
    unsigned char *orig_lina = lina;
    int err;

    if (opa.repe || opa.repne) {
	err = repeat(&lina, &emu_s_outs, &emu_e_outs);
    } else {
	err = once(&lina, &emu_s_outs, &emu_e_outs);
    }
    if (!err)
	REG(eip) += lina-orig_lina;
    return err;
}
Beispiel #11
0
VP10Decoder *vp10_decoder_create(BufferPool *const pool) {
  VP10Decoder *volatile const pbi = vpx_memalign(32, sizeof(*pbi));
  VP10_COMMON *volatile const cm = pbi ? &pbi->common : NULL;

  if (!cm)
    return NULL;

  vp10_zero(*pbi);

  if (setjmp(cm->error.jmp)) {
    cm->error.setjmp = 0;
    vp10_decoder_remove(pbi);
    return NULL;
  }

  cm->error.setjmp = 1;

  CHECK_MEM_ERROR(cm, cm->fc,
                  (FRAME_CONTEXT *)vpx_calloc(1, sizeof(*cm->fc)));
  CHECK_MEM_ERROR(cm, cm->frame_contexts,
                  (FRAME_CONTEXT *)vpx_calloc(FRAME_CONTEXTS,
                  sizeof(*cm->frame_contexts)));

  pbi->need_resync = 1;
  once(initialize_dec);

  // Initialize the references to not point to any frame buffers.
  memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map));
  memset(&cm->next_ref_frame_map, -1, sizeof(cm->next_ref_frame_map));

  cm->current_video_frame = 0;
  pbi->ready_for_new_data = 1;
  pbi->common.buffer_pool = pool;

  cm->bit_depth = VPX_BITS_8;
  cm->dequant_bit_depth = VPX_BITS_8;

  cm->alloc_mi = vp10_dec_alloc_mi;
  cm->free_mi = vp10_dec_free_mi;
  cm->setup_mi = vp10_dec_setup_mi;

  vp10_loop_filter_init(cm);

  cm->error.setjmp = 0;

  vpx_get_worker_interface()->init(&pbi->lf_worker);

  return pbi;
}
Beispiel #12
0
void cluster_builder::calc(const std::vector<cv::Point2f> &pts0, std::vector<std::vector<cv::Point2f> > &result)
{
	std::vector<cv::Point2f> pts = pts0;
	std::vector<Cluster> clusters;

	double threshold = threshold_;

	while (!pts.empty()) {
		once(pts, clusters, threshold);
		threshold /= 2;		// 增加创建新的 cluster 的机会 ....
	}

	merge_clusters(clusters);	// 合并 ..

	for (std::vector<Cluster>::const_iterator it = clusters.begin(); it != clusters.end(); ++it) {
		result.push_back(it->pts);
	}
}
Beispiel #13
0
static void switchtonextlevel(void)
{
	struct initrec** inittab = cfg->inittab;
	struct initrec** pp;
	struct initrec* p;

	/* One we're here, reset pid for r-type entries, to run them when
	   entering another runlevel with shouldberunning(p) true. */
	for(pp = inittab; (p = *pp); pp++)
		if(!shouldberunning(p) && once(p) && (p->pid < 0))
			p->pid = 0;

	if(slippery(nextlevel) && !slippery(currlevel)) {
		/* nextlevel is slippery, turn back to currlevel */
		swapi(&currlevel, &nextlevel);
		/* We've got to make sure pollfds will return immediately. */
		timetowait = 0;
	} else {
		currlevel = nextlevel;
	}
}
int main()
{
    try
    {
        using once  = Once;
        using times = Times;

        // run-time configurable:

        const int  Nsweep    = 1;
        const int  Nsection  = 2;
        const bool onceX     = true;

              auto scanner   = create_scanner  ( "Z" );
        const auto distance  = create_condition( "123 nm" );
        const auto threshold = create_condition( "chan1", "<=", "2.7 V" );

        Curve curve;

        curve.times( Nsweep )
             .scans( scanner )
             .add  (        Retract().stop_on( distance )   ).unless( onceX )
             .add  ( once ( Retract().stop_on( distance ) ) ).when  ( onceX )
             .add  ( times( Nsection )
                     .add ( Dwell()                         )
                     .add ( Approach().stop_on( threshold ) )
                     .add ( Dwell()                         )
                     .add ( Retract ().stop_on( distance  ) ) )
             ;

        std::cout << "\n1.curve.sweep(): "; curve.sweep();
        std::cout << "\n2.curve.sweep(): "; curve.sweep();
    }
    catch ( std::exception const & e )
    {
        std::cout << "Error: " << e.what() << std::endl;
    }
}
Beispiel #15
0
int Executor::daemonizeExecutor()
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->daemonizeExecutor();
}
Beispiel #16
0
void av1_rtcd() {
  // TODO(JBB): Remove this once, by insuring that both the encoder and
  // decoder setup functions are protected by once();
  once(setup_rtcd_internal);
}
Beispiel #17
0
AV1Decoder *av1_decoder_create(BufferPool *const pool) {
  AV1Decoder *volatile const pbi = aom_memalign(32, sizeof(*pbi));
  AV1_COMMON *volatile const cm = pbi ? &pbi->common : NULL;

  if (!cm) return NULL;

  av1_zero(*pbi);

  if (setjmp(cm->error.jmp)) {
    cm->error.setjmp = 0;
    av1_decoder_remove(pbi);
    return NULL;
  }

  cm->error.setjmp = 1;

  CHECK_MEM_ERROR(cm, cm->fc,
                  (FRAME_CONTEXT *)aom_memalign(32, sizeof(*cm->fc)));
  CHECK_MEM_ERROR(cm, cm->frame_contexts,
                  (FRAME_CONTEXT *)aom_memalign(
                      32, FRAME_CONTEXTS * sizeof(*cm->frame_contexts)));
  memset(cm->fc, 0, sizeof(*cm->fc));
  memset(cm->frame_contexts, 0, FRAME_CONTEXTS * sizeof(*cm->frame_contexts));

  pbi->need_resync = 1;
  once(initialize_dec);

  // Initialize the references to not point to any frame buffers.
  memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map));
  memset(&cm->next_ref_frame_map, -1, sizeof(cm->next_ref_frame_map));

  cm->current_video_frame = 0;
  pbi->ready_for_new_data = 1;
  pbi->common.buffer_pool = pool;

  cm->bit_depth = AOM_BITS_8;
  cm->dequant_bit_depth = AOM_BITS_8;

  cm->alloc_mi = av1_dec_alloc_mi;
  cm->free_mi = av1_dec_free_mi;
  cm->setup_mi = av1_dec_setup_mi;

  av1_loop_filter_init(cm);

#if CONFIG_NCOBMC_ADAPT_WEIGHT
  get_default_ncobmc_kernels(cm);
#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT

#if CONFIG_AOM_QM
  aom_qm_init(cm);
#endif
#if CONFIG_LOOP_RESTORATION
  av1_loop_restoration_precal();
#endif  // CONFIG_LOOP_RESTORATION
#if CONFIG_ACCOUNTING
  pbi->acct_enabled = 1;
  aom_accounting_init(&pbi->accounting);
#endif

  cm->error.setjmp = 0;

  aom_get_worker_interface()->init(&pbi->lf_worker);

  return pbi;
}
Beispiel #18
0
	session::session(std::string const &cs, once_functor const &f)
	{
		open(cs);
		once(f);
	}
Beispiel #19
0
	session::session(connection_info const &ci, once_functor const &f)
	{
		open(ci);
		once(f);
	}
Beispiel #20
0
	session::session(ref_ptr<backend::connection> conn, once_functor const &f) : conn_(conn)
	{
		once(f);
	}
Beispiel #21
0
void initpass(void)
{
	int waitfor = 0;
	struct initrec** pp;
	struct initrec* p;

	if(!cfg->inittab || cfg->initnum <= 0)
		goto done; /* should never happen, but who knows */

	struct initrec** inittab = cfg->inittab;
	struct initrec** initend = cfg->inittab + cfg->initnum - 1;

	/* Kill pass, reverse order */
	for(pp = initend; (p = *pp); pp--)
		if(!shouldberunning(p) && p->pid > 0)
		{
			stop(p);

			waitfor |= DYING;

			if(onceonly(p))
				return;
		}

	/* Run pass, direct order */
	for(pp = inittab; (p = *pp); pp++)
		if(shouldberunning(p))
		{
			if(p->pid > 0) {
				if(oncewait(p))
					return;
				else if(once(p))
					waitfor |= RUNNING;
				continue;
			}

			if(p->pid < 0 && once(p))
				continue; /* has been run already */
			if(waitfor && oncewait(p))
				return;

			if(!once(p) && slippery(nextlevel))
				continue; /* these will be killed anyway */

			spawn(p);

			if(once(p))
				waitfor |= RUNNING;
			if(oncewait(p))
				return;
		}

	if(waitfor)
		return;

done:	if(nextlevel == (1<<0)) {
		/* level 0 is slippery in its own particular way */
		currlevel = nextlevel;
		nextlevel = 0;
		timetowait = 0;
	} else if(currlevel != nextlevel)
		switchtonextlevel();
}
Beispiel #22
0
void vpx_dsp_rtcd() {
  once(setup_rtcd_internal);
}
Beispiel #23
0
int Executor::reapProviderAgent(
    int pid)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->reapProviderAgent(pid);
}
Beispiel #24
0
int Executor::validateUser(
    const char* username)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->validateUser(username);
}
Beispiel #25
0
void vpx_scale_rtcd() { once(setup_rtcd_internal); }
Beispiel #26
0
int Executor::ping()
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->ping();
}
Beispiel #27
0
int Executor::removeFile(
    const char* path)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->removeFile(path);
}
Beispiel #28
0
void WebRtcSpl_Init() {
  once(InitFunctionPointers);
}
Beispiel #29
0
void TestOnce::loop()
{
  once();
  if (state == LOOPING) state = DONE_PASS;
}
Beispiel #30
0
int Executor::updateLogLevel(
    const char* logLevel)
{
    once(&_executorImplOnce, _initExecutorImpl);
    return _executorImpl->updateLogLevel(logLevel);
}