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


C++ DC_Exit函数代码示例

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


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

示例1: dprintf

void
BaseShadow::reconnectFailed( const char* reason )
{
		// try one last time to release the claim, write a UserLog event
		// about it, and exit with a special status. 
	dprintf( D_ALWAYS, "Reconnect FAILED: %s\n", reason );
	
	logReconnectFailedEvent( reason );

		// if the shadow was born disconnected, exit with 
		// JOB_RECONNECT_FAILED so the schedd can make 
		// an accurate restart report.  otherwise just
		// exist with JOB_SHOULD_REQUEUE.
	if ( attemptingReconnectAtStartup ) {
		dprintf(D_ALWAYS,"Exiting with JOB_RECONNECT_FAILED\n");
		// does not return
		DC_Exit( JOB_RECONNECT_FAILED );
	} else {
		dprintf(D_ALWAYS,"Exiting with JOB_SHOULD_REQUEUE\n");
		// does not return
		DC_Exit( JOB_SHOULD_REQUEUE );
	}

	// Should never get here....
	ASSERT(true);
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:26,代码来源:baseshadow.cpp

示例2: main_shutdown_graceful

// this can be called by other functions, or by DC when the schedd is
// shutdown gracefully
void main_shutdown_graceful() {
	print_status();
	dagman.dag->DumpNodeStatus( true, false );
	dagman.dag->GetJobstateLog().WriteDagmanFinished( EXIT_RESTART );
	dagman.CleanUp();
	DC_Exit( EXIT_RESTART );
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:9,代码来源:dagman_main.cpp

示例3: request_pipe_handler

int
request_pipe_handler(Service*, int) {

	std::string* next_line;
	while ((next_line = request_buffer.GetNextLine()) != NULL) {

		dprintf (D_FULLDEBUG, "got work request: %s\n", next_line->c_str());

		Gahp_Args args;

			// Parse the command...
		if (!(parse_gahp_command (next_line->c_str(), &args) &&
			  handle_gahp_command (args.argv, args.argc))) {
			dprintf (D_ALWAYS, "ERROR processing %s\n", next_line->c_str());
		}

			// Clean up...
		delete  next_line;
	}

	// check for an error in GetNextLine
	if (request_buffer.IsError() || request_buffer.IsEOF()) {
		dprintf (D_ALWAYS, "Request pipe closed. Exiting...\n");
		DC_Exit (1);
	}

	return TRUE;
}
开发者ID:bbockelm,项目名称:condor-network-accounting,代码行数:28,代码来源:schedd_client.cpp

示例4: cleanUp

int
VMGahp::quitFast()
{
	cleanUp();
	DC_Exit(0);
	return TRUE;
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:7,代码来源:vmgahp.cpp

示例5: while

int
VMGahp::waitForCommand(int   /*pipe_end*/)
{
	MyString *line = NULL;

	while((line = m_request_buffer.GetNextLine()) != NULL) {

		const char *command = line->Value();

		Gahp_Args args;
		VMRequest *new_req = NULL;

		if( m_inClassAd )  {
			if( strcasecmp(command, VMGAHP_COMMAND_CLASSAD_END) == 0 ) {
				m_inClassAd = false;

				// Everything is Ok. Now we got vmClassAd
				returnOutputSuccess();
			}else {
				if( !m_jobAd->Insert(command) ) {
					vmprintf(D_ALWAYS, "Failed to insert \"%s\" into classAd, "
							"ignoring this attribute\n", command);
				}
			}
		}else {
			if(parse_vmgahp_command(command, args) &&
					verifyCommand(args.argv, args.argc)) {
				new_req = preExecuteCommand(command, &args);

				if( new_req != NULL ) {
					// Execute the new request
					executeCommand(new_req);
					if(new_req->m_has_result) {
						movePendingReqToResultList(new_req);
						if (m_async_mode) {
							if (!m_new_results_signaled) {
								write_to_daemoncore_pipe("R\n");
							}
							// So that we only do it once
							m_new_results_signaled = true;
						}
					}
				}
			}else {
				returnOutputError();
			}
		}

		delete line;
		line = NULL;
	}

	// check if GetNextLine() returned NULL because of an error or EOF
	if(m_request_buffer.IsError() || m_request_buffer.IsEOF()) {
		vmprintf(D_ALWAYS, "Request buffer closed, exiting\n");
		cleanUp();
		DC_Exit(0);
	}
	return true;
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:60,代码来源:vmgahp.cpp

示例6: DC_Exit

void
BaseShadow::shutDown( int reason ) 
{
		// exit now if there is no job ad
	if ( !getJobAd() ) {
		DC_Exit( reason );
	}
	
		// if we are being called from the exception handler, return
		// now to prevent infinite loop in case we call EXCEPT below.
	if ( reason == JOB_EXCEPTION ) {
		return;
	}

		// Only if the job is trying to leave the queue should we
		// evaluate the user job policy...
	if( reason == JOB_EXITED || reason == JOB_COREDUMPED ) {
		if( !waitingToUpdateSchedd() ) {
			shadow_user_policy.checkAtExit();
				// WARNING: 'this' may have been deleted by the time we get here!!!
		}
	}
	else {
		// if we aren't trying to evaluate the user's policy, we just
		// want to evict this job.
		evictJob( reason );
	}
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:28,代码来源:baseshadow.cpp

示例7: master_exit

int
master_exit(int retval)
{
	cleanup_memory();

#ifdef WIN32
	if ( NT_ServiceFlag == TRUE ) {
		terminate(retval);
	}
#endif

#if defined(WANT_CONTRIB) && defined(WITH_MANAGEMENT)
#if defined(HAVE_DLOPEN) || defined(WIN32)
	MasterPluginManager::Shutdown();
#endif
#endif

		// If we're positive that we are going to shut down,
		// we should clean out the shared port directory if
		// we created it.
	std::string dirname;
	if ( SharedPortEndpoint::CreatedSharedPortDirectory() &&
		 SharedPortEndpoint::GetDaemonSocketDir(dirname) ) {

		TemporaryPrivSentry tps(PRIV_CONDOR);
		Directory d(dirname.c_str());
		d.Remove_Entire_Directory();
		if (-1 == rmdir(dirname.c_str())) {
			dprintf(D_ALWAYS, "ERROR: failed to remove shared port temporary directory: %s (errno=%d).\n", strerror(errno), errno);
		}
	}

	DC_Exit(retval, shutdown_program );
	return 1;	// just to satisfy vc++
}
开发者ID:zhangzhehust,项目名称:htcondor,代码行数:35,代码来源:master.cpp

示例8: main_shutdown_graceful

void
main_shutdown_graceful( )
{
    dprintf( D_ALWAYS, "main_shutdown_graceful started\n" );

    delete stateMachine;
    DC_Exit( 0 );
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:8,代码来源:Replication.cpp

示例9: holdJob

void
BaseShadow::holdJobAndExit( const char* reason, int hold_reason_code, int hold_reason_subcode )
{
	holdJob(reason,hold_reason_code,hold_reason_subcode);

	// finally, exit and tell the schedd what to do
	DC_Exit( JOB_SHOULD_HOLD );
}
开发者ID:emaste,项目名称:htcondor,代码行数:8,代码来源:baseshadow.cpp

示例10: usage

void
usage()
{
	dprintf( D_ALWAYS,
		"Usage: condor_ft-gahp\n"
			 );
	DC_Exit( 1 );
}
开发者ID:zhangzhehust,项目名称:htcondor,代码行数:8,代码来源:io_loop.cpp

示例11: main_init

void main_init(int  argc , char *  argv  [])
{
	char *testfile = NULL;
	ClassAd *inputAd = NULL;
	int i;

	dprintf(D_ALWAYS, "main_init() called\n");

	for (i=1; i<argc; i++ ) {
	
		if (match_prefix(argv[i],"-withfile")) {
			i++;
			if (argc <= i) {
				fprintf(stderr,
						"ERROR: Argument -withfile requires a parameter\n ");
				exit(1);
			}
			testfile = argv[i];
		}
	
	}	// end of parsing command line options

	if ( testfile ) {
		FILE* fp = safe_fopen_wrapper(testfile,"r");
		if (!fp) {
			fprintf(stderr,"ERROR: Unable to open test file %s\n",
					testfile);
			DC_Exit(1);
		}
		int EndFlag=0, ErrorFlag=0, EmptyFlag=0;
        if( !( inputAd=new ClassAd(fp,"***", EndFlag, ErrorFlag, EmptyFlag) ) ){
            fprintf( stderr, "ERROR:  Out of memory\n" );
            DC_Exit( 1 );
        }
		fclose(fp);
		if ( ErrorFlag || EmptyFlag ) {
			fprintf( stderr, "ERROR - file %s does not contain a parseable ClassAd\n",
					 testfile);
			DC_Exit(1);
		}
		// since this option is for testing, process then exit
		ClassAd * resultAd =  process_request(inputAd);
		dPrintAd(D_ALWAYS, *resultAd);
		DC_Exit( 0 );
	}
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:46,代码来源:soapshell_main.cpp

示例12: ExitSuccess

void ExitSuccess() {
	print_status();
	dagman.dag->DumpNodeStatus( false, false );
	dagman.dag->GetJobstateLog().WriteDagmanFinished( EXIT_OKAY );
	tolerant_unlink( lockFileName ); 
	dagman.CleanUp();
	DC_Exit( EXIT_OKAY );
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:8,代码来源:dagman_main.cpp

示例13: usage

void
usage( char *name )
{
	dprintf( D_ALWAYS, 
		"Usage: %s [-f] [-b] [-t] [-p <port>] [-s <schedd addr>] [-o <[email protected]>] [-C <job constraint>] [-S <scratch dir>] [-A <aux id>]\n",
		condor_basename( name ) );
	DC_Exit( 1 );
}
开发者ID:bbockelm,项目名称:htcondor,代码行数:8,代码来源:gridmanager_main.cpp

示例14: main_shutdown_fast

void
main_shutdown_fast()
{
#ifndef WIN32
	if (io_loop_pid != -1)
		kill(io_loop_pid, SIGKILL);
#endif
	DC_Exit(0);
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:9,代码来源:schedd_client_main.cpp

示例15: main_shutdown_graceful

void
main_shutdown_graceful()
{
#ifndef WIN32
	if (io_loop_pid != -1)
		kill(io_loop_pid, SIGTERM);
#endif
	DC_Exit(0);
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:9,代码来源:schedd_client_main.cpp


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