当前位置: 首页>>代码示例>>C++>>正文


C++ release_context函数代码示例

本文整理汇总了C++中release_context函数的典型用法代码示例。如果您正苦于以下问题:C++ release_context函数的具体用法?C++ release_context怎么用?C++ release_context使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了release_context函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ibmca_finish

static int ibmca_finish(ENGINE *e)

        {

        if(ibmca_dso == NULL)

                {

                IBMCAerr(IBMCA_F_IBMCA_FINISH,IBMCA_R_NOT_LOADED);

                return 0;

                }

        release_context(handle);

        if(!DSO_free(ibmca_dso))

                {

                IBMCAerr(IBMCA_F_IBMCA_FINISH,IBMCA_R_DSO_FAILURE);

                return 0;

                }

        ibmca_dso = NULL;



        return 1;

        }
开发者ID:x684867,项目名称:nemesis,代码行数:33,代码来源:hw_ibmca.c

示例2: hwcrhk_finish

static int hwcrhk_finish(ENGINE *e)
	{
	int to_return = 1;
	free_HWCRHK_LIBNAME();
	if(hwcrhk_dso == NULL)
		{
		HWCRHKerr(HWCRHK_F_HWCRHK_FINISH,HWCRHK_R_NOT_LOADED);
		to_return = 0;
		goto err;
		}
	release_context(hwcrhk_context);
	if(!DSO_free(hwcrhk_dso))
		{
		HWCRHKerr(HWCRHK_F_HWCRHK_FINISH,HWCRHK_R_DSO_FAILURE);
		to_return = 0;
		goto err;
		}
 err:
	if (logstream)
		BIO_free(logstream);
	hwcrhk_dso = NULL;
	p_hwcrhk_Init = NULL;
	p_hwcrhk_Finish = NULL;
	p_hwcrhk_ModExp = NULL;
#ifndef OPENSSL_NO_RSA
	p_hwcrhk_RSA = NULL;
	p_hwcrhk_RSALoadKey = NULL;
	p_hwcrhk_RSAGetPublicKey = NULL;
	p_hwcrhk_RSAUnloadKey = NULL;
#endif
	p_hwcrhk_ModExpCRT = NULL;
	p_hwcrhk_RandomBytes = NULL;
	return to_return;
	}
开发者ID:SibghatullahSheikh,项目名称:voip-client-ios,代码行数:34,代码来源:e_chil.c

示例3: main

int
main(void)
{
  context_t *context = alloc_context();
  if (!context)
    {
      printf("T:  Failed to create new context.\n");
      return 1;
    }
  for (int i = 0; i < 5; i++)
    {
      measurement_t measurement;
      if (measure(context, &measurement) == 0)
        {
          printf("T:  Time = %.1u, Value = %.3f\n",
                 measurement.time, measurement.value);
        }
      else
        {
          printf("T:  Failed to obtain measurement.\n");
        }
    }
  if (release_context(context) != 0)
    {
      printf("T:  Failed to release context.\n");
      return 1;
    }
  return 0;
}
开发者ID:mjhanninen,项目名称:hs-ffi-example,代码行数:29,代码来源:test_frobnicator.c

示例4: cb_Exit

HOT_INLINE
static void cb_Exit(
    hot_contextID_t id, 
    unsigned *cs
) {
    hot_context_t s;
    hot_ens_Exit_cback exit_cb;
    void *env;
    
    begin_critical(); {
	s = lookup_context(id);
	if (!s->leaving)
	    hot_sys_Panic("hot_ens_Exit_cbd: mbr state is not leaving");
	env = s->env;
	exit_cb = s->conf.exit;
    }  end_critical();

    if (exit_cb != NULL) {
	(*exit_cb)(s, env);
    }  

    begin_critical(); {
	release_context(s);
    } end_critical();  
}
开发者ID:4og,项目名称:avango,代码行数:25,代码来源:hot_outboard_c.c

示例5: main

int main( int argc, char **argv )
{
    if(argc == 1)
    {
        printf("usage: %s shader.glsl [mesh.obj] [texture0.png [texture1.png]]\n", argv[0]);
        return 0;
    }
    
    Window window= create_window(1024, 640);
    if(window == NULL) 
        return 1;
    
    Context context= create_context(window);
    if(context == NULL) 
        return 1;
    
    // creation des objets opengl
    std::vector<const char *> options(argv + 1, argv + argc);
    if(init(options) < 0)
    {
        printf("[error] init failed.\n");
        return 1;
    }
    
    // affichage de l'application
    run(window, draw);

    // nettoyage
    quit();
    release_context(context);
    release_window(window);
    return 0;
}
开发者ID:PierreCAMILLI,项目名称:mif23-projet,代码行数:33,代码来源:shader_kit.cpp

示例6: main

int main( int argc, char **argv )
{
    // etape 1 : creer la fenetre
    Window window= create_window(1024, 640);
    if(window == NULL) 
        return 1;       // erreur lors de la creation de la fenetre ou de l'init de sdl2
    
    // etape 2 : creer un contexte opengl pour pouvoir dessiner
    Context context= create_context(window);
    if(context == NULL) 
        return 1;       // erreur lors de la creation du contexte opengl
    
    // etape 3 : creation des objets 
    if(init() < 0)
    {
        printf("[error] init failed.\n");
        return 1;
    }
    
    // etape 4 : affichage de l'application, tant que la fenetre n'est pas fermee. ou que draw() ne renvoie pas 0
    run(window, draw);

    // etape 5 : nettoyage
    quit();
    release_context(context);
    release_window(window);
    return 0;
}
开发者ID:PierreCAMILLI,项目名称:mif23-projet,代码行数:28,代码来源:tuto4.cpp

示例7: cswift_init

/* (de)initialisation functions. */
static int cswift_init(ENGINE *e)
	{
        SW_CONTEXT_HANDLE hac;
        t_swAcquireAccContext *p1;
        t_swAttachKeyParam *p2;
        t_swSimpleRequest *p3;
        t_swReleaseAccContext *p4;

	if(cswift_dso != NULL)
		{
		CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_ALREADY_LOADED);
		goto err;
		}
	/* Attempt to load libswift.so/swift.dll/whatever. */
	cswift_dso = DSO_load(NULL, get_CSWIFT_LIBNAME(), NULL, 0);
	if(cswift_dso == NULL)
		{
		CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_NOT_LOADED);
		goto err;
		}
	if(!(p1 = (t_swAcquireAccContext *)
				DSO_bind_func(cswift_dso, CSWIFT_F1)) ||
			!(p2 = (t_swAttachKeyParam *)
				DSO_bind_func(cswift_dso, CSWIFT_F2)) ||
			!(p3 = (t_swSimpleRequest *)
				DSO_bind_func(cswift_dso, CSWIFT_F3)) ||
			!(p4 = (t_swReleaseAccContext *)
				DSO_bind_func(cswift_dso, CSWIFT_F4)))
		{
		CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_NOT_LOADED);
		goto err;
		}
	/* Copy the pointers */
	p_CSwift_AcquireAccContext = p1;
	p_CSwift_AttachKeyParam = p2;
	p_CSwift_SimpleRequest = p3;
	p_CSwift_ReleaseAccContext = p4;
	/* Try and get a context - if not, we may have a DSO but no
	 * accelerator! */
	if(!get_context(&hac))
		{
		CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_UNIT_FAILURE);
		goto err;
		}
	release_context(hac);
	/* Everything's fine. */
	return 1;
err:
	if(cswift_dso)
	{
		DSO_free(cswift_dso);
		cswift_dso = NULL;
	}
	p_CSwift_AcquireAccContext = NULL;
	p_CSwift_AttachKeyParam = NULL;
	p_CSwift_SimpleRequest = NULL;
	p_CSwift_ReleaseAccContext = NULL;
	return 0;
	}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:60,代码来源:e_cswift.c

示例8: check_call

	booster::shared_ptr<json_call> json_rpc_server::release_call()
	{
		check_call();
		current_call_->attach_context(release_context());
		booster::shared_ptr<json_call> call = current_call_;
		current_call_.reset();
		return call;
	}
开发者ID:klupek,项目名称:cppcms,代码行数:8,代码来源:rpc_json.cpp

示例9: single

	void single()
	{
		calls ++;
		std::ostream &out = response().out();
		for(unsigned i=0;i<10000000;i++) {
			out << i << '\n';
		}
		release_context()->async_complete_response();
	}
开发者ID:klupek,项目名称:cppcms,代码行数:9,代码来源:disco_test.cpp

示例10: multiple

	void multiple()
	{
		calls ++;
		binder call;
		call.context = release_context();
		call.counter = 10000;
		call(cppcms::http::context::operation_completed);

	}
开发者ID:klupek,项目名称:cppcms,代码行数:9,代码来源:disco_test.cpp

示例11: kherr_release_context

/* Should NOT be called with cs_error held */
KHMEXP void KHMAPI
kherr_release_context(kherr_context * c)
{
    if (!IS_KHERR_CTX(c))
        return;

    EnterCriticalSection(&cs_error);
    release_context(c);
    LeaveCriticalSection(&cs_error);
}
开发者ID:secure-endpoints,项目名称:netidmgr,代码行数:11,代码来源:kherr.c

示例12: response

	void json_rpc_server::main(std::string /*unused*/)
	{
		if(!smd_.empty() && request().request_method()=="GET") {

			response().set_content_header("application/json");
			response().out() << smd_;

			if(is_asynchronous())
				release_context()->async_complete_response();
			return;
		}

		try {
			current_call_.reset(new json_call(context()));
			methods_map_type::iterator p=methods_.find(method());
			if(p==methods_.end()) {
				if(!notification())
					return_error("Method not found");
				return;
			}
			if(p->second.role == notification_role && !notification()) {
				return_error("The request should be notification");
				return;
			}
			if(p->second.role == method_role && notification()) {
				// No way to respond according to protocol
				return;
			}
			try {
				p->second.method(params());
			}
			catch(json::bad_value_cast const &e) {
				if(current_call_.get() && !notification())
					return_error("Invalid parameters");
				return;
			}
			catch(call_error const &e) {
				if(current_call_.get() && !notification())
					return_error(e.what());
				return;
			}
			catch(std::exception const &e) {
				if(current_call_.get() && !notification())
					return_error("Internal Service Error");
				return;
			}
		}
		catch(call_error const &e)
		{
			response().set_content_header("text/plain");
			response().out()<< e.what() << std::endl;
		}
	}
开发者ID:klupek,项目名称:cppcms,代码行数:53,代码来源:rpc_json.cpp

示例13: kherr_pop_context

/* Should NOT be called with cs_error held */
KHMEXP void KHMAPI
kherr_pop_context(void)
{
    kherr_context * c;

    EnterCriticalSection(&cs_error);
    c = pop_context();
    if(IS_KHERR_CTX(c)) {
        release_context(c);
    }
    LeaveCriticalSection(&cs_error);
}
开发者ID:secure-endpoints,项目名称:netidmgr,代码行数:13,代码来源:kherr.c

示例14: release_context

/* MUST be called with cs_error held */
static void
release_context(kherr_context * c)
{
    if (IS_KHERR_CTX(c)) {
        c->refcount--;

        {
            kherr_event * e;

            e = QBOTTOM(c);
            if (IS_KHERR_EVENT(e) && !(e->flags & KHERR_RF_COMMIT)) {
                commit_event(c, e);
            }
        }

        if (c->refcount == 0) {
            kherr_context * p;

            if (CTX_USES_OWN_PROGRESS(c)) {
                set_and_notify_progress_change(c, 256, 256);
            }

            p = TPARENT(c);

#ifdef DEBUG
	    kherr_debug_printf(L"Posting KHERR_CTX_END for %p\n", (void *) c);
#endif
            notify_ctx_event(KHERR_CTX_END, c, NULL, NULL, 0);

            if (IS_KHERR_CTX(p)) {
                kherr_event * e;

                e = fold_context(c);
                TDELCHILD(p, c);
                
		if (e) {
                    add_event(p, e);
		    notify_ctx_event(KHERR_CTX_FOLDCHILD, p, NULL, e, 0);
		}

                release_context(p);
            } else {
                LDELETE(&ctx_root_list, c);
            }
            free_context(c);
        }
    }
}
开发者ID:secure-endpoints,项目名称:netidmgr,代码行数:49,代码来源:kherr.c

示例15: test_query_string

void test_query_string() {
  void* ctx;
  parse_query_string(&ctx, "width=640&height=360&video=bigbunny.ogg");
  const char* width = get_parameter(ctx, "width");
  const char* height = get_parameter(ctx, "height");
  const char* video = get_parameter(ctx, "video");
  if(!strcmp(width,"640")) {
      printf("Querystring width esperado:%s - recebido:%s\n", "640", width);
  }
  if(!strcmp(height,"360")) {
      printf("Querystring height esperado:%s - recebido:%s\n", "360", height);
  }
  if(!strcmp(video,"bigbunny.ogg")) {
      printf("Querystring video esperado:%s - recebido:%s\n", "bigbunny.ogg", video);
  }
  release_context(ctx);
}
开发者ID:dayvson,项目名称:Apache-Get-Video-Thumbnail,代码行数:17,代码来源:main.c


注:本文中的release_context函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。