void CApaAppInstallationMonitor::RunL()
{
    if(iStatus.Int() == KErrNone)
    {
        DoStart();

        if (iWaitingForStartInstallation)
        {
            if (InstallationInProgress())
            {
                iWaitingForStartInstallation = EFalse;
                iApaServer->HandleInstallationStartEvent();
            }
        }

        else
        {   // waiting for end Installation
            if (!InstallationInProgress())
            {
                iWaitingForStartInstallation = ETrue;
                TRAP_IGNORE(iApaServer->HandleInstallationEndEventL()); // let user try again if OOM
            }
        }
    }
}
Пример #2
0
int Task::Start(u_int32_t uiProcessNum, u_int32_t uiRate, bool bByTaskIdx)
{
	signal(SIGCHLD, SIG_IGN);
	
    if(0 == uiProcessNum)
		uiProcessNum = 1;

	if(uiRate > 0)
		m_cFMgr.Open(uiRate);

	m_uiRate = uiRate;
	
	for(unsigned int i = 1; i <= uiProcessNum; i++)
	{
	    int iPid = fork();
		if(0 == iPid)
		{
		    InitDaemon();
			
		    DoStart(i, bByTaskIdx);
			
		    exit(0);
		}
		else if(iPid < 0)
		{
		    BOSS_ERROR("fork %d error: %s", i, strerror(errno));
		}
	}

	return 0;
}
Пример #3
0
void CApaAppUnInstallMonitor::RunL()
	{
	if(iStatus.Int() == KErrNone)
		{
		DoStart();
		
		if (iWaitingForStartUninstall)
			{
			if (UnInstallInProgress())
				{
				iWaitingForStartUninstall = EFalse;
				iApaServer->HandleStartUninstallEvent();
				}
			}
		else
			{ // waiting for end uninstall
			if (!UnInstallInProgress())
				{
				iWaitingForStartUninstall = ETrue;
				TRAP_IGNORE(iApaServer->HandleEndUninstallEventL()); // let user try again if OOM
				}
			
			}
		}
	}
// -----------------------------------------------------------------------------
// CSTSBTSapListener::RunL
// (other items were commented in a header).
// -----------------------------------------------------------------------------
void CSTSBTSapListener::RunL()
{
    TInt btSapState;
    iProperty.Get(btSapState);
    switch (btSapState)
    {
    case EBTSapNotConnected:
    case EBTSapConnecting: // BT Sap not connected, no actions
    {
        DoStart();
        break;
    }
    case EBTSapConnected:
    {
        //close the connection
        iObserver->NotifyClose(MSTSCloseObserver::ESTSBTSapInUse);
        break;
    }
    default:
    {
        //no actions needed
        break;
    }
    }
}
Пример #5
0
__override HRESULT CGeometricMediaSource::DispatchOperation(CSourceOperation *pOp)
{
	AutoLock lock(_critSec);

    HRESULT hr = CheckShutdown();

    if (SUCCEEDED(hr))
    {
        switch(pOp->GetOperationType())
        {
        case CSourceOperation::Operation_Start:
            hr = DoStart(static_cast<CStartOperation *>(pOp));
            break;
        case CSourceOperation::Operation_Stop:
            hr = DoStop(pOp);
            break;
        case CSourceOperation::Operation_SetRate:
            hr = DoSetRate(static_cast<CSetRateOperation *>(pOp));
            break;
        default:
            hr = E_UNEXPECTED;
            break;
        }
    }

    return hr;
}
Пример #6
0
void CClkMdlResponder::Start(void)
{
  if(!IsActive())
  {
    SetActive();
    DoStart();
  }
}
Пример #7
0
/* do_main()
 * ================================================================
 */
void
do_main( void )
{
   int result;
   
   do
   {
     /* Do Introduction Dialog Box */
     intro_dialog();
     result = TRUE;

     /* Do Assign.SYS Dialog Box */
     if( result )
         result = assign_dialog();

     /* Do APath Dialog Box */
     if( result )
         result = path_dialog();

     /* Do EXTEND.SYS Dialog Box */
     if( result )
        result = extend_dialog();

     /* Do EPATH Dialog Box */
     if( result )
         result = epath_dialog();

     /* Do Driver Dialog Box */
     if( result )
         result = driver_dialog();

#if 0

     /* Do Fonts Dialog Box */
     if( result )
         result = fonts_dialog();

     /* Do Application Dialog Box */
     if( result )
         result = apps_dialog();
#endif

     /* Do Start Dialog Box */
     if( result )
         result = DoStart();

     /* Go To main loop */
     if( result )
         DoInstall();

   }while( !result );

   /* Display Complete */
   if( vq_gdos() )
      DoGDOS();	     	/* Display warning of a previously loaded GDOS */
   else
     DoComplete();	/* Standard reboot exit message */
}
// -----------------------------------------------------------------------------
// CSatSSimSubscriberId::Start
// Starts the handler initially.
// -----------------------------------------------------------------------------
//
void CSatSSimSubscriberId::Start()
    {
    LOG( SIMPLE, "SATENGINE: CSatSSimSubscriberId::Start calling" )

    iRetryCounter = KMaxRetry;
    DoStart();

    LOG( SIMPLE, "SATENGINE: CSatSSimSubscriberId::Start exiting" )
    }
Пример #9
0
void wxStopWatch::Start(long t0)
{
    // Calling Start() makes the stop watch run however many times it was
    // paused before.
    m_pauseCount = 0;

    DoStart();

    m_t0 -= (wxLongLong(t0)*GetClockFreq())/MILLISECONDS_PER_SECOND;
}
Пример #10
0
void BetProcedureFrame::OnStart(wxCommandEvent& event) {
	if (state_ == STATE_INITIAL) {
		if (validate())
			DoStart();
		return;
	}
	if (state_ == STATE_RUNNING) {
		DoGoInFinishing();
		return;
	}
}
Пример #11
0
static void Start(TCHAR b, LONGINT adr)
{
   I2C_Power(TRUE, FALSE);	/* Power on memories */
//   di();			/* Disable interrupts */
   DoStart(); 

   /* start sending the data */
   SendByteAck(b);
   SendByteAck((TCHAR)(adr>>8));	/* output remainder of address */
   SendByteAck((TCHAR)(adr));  
} /* end Start() */
Пример #12
0
bool wxMotifTimerImpl::Start(int milliseconds, bool mode)
{
    if ( !wxTimerImpl::Start(milliseconds, mode) )
        return false;

    if ( gs_timers.find(this) == gs_timers.end() )
        gs_timers[this] = this;

    DoStart();

    return true;
}
Пример #13
0
DAPI_(HRESULT) JsonWriteObjectStart(
    __in JSON_WRITER* pWriter
    )
{
    HRESULT hr = S_OK;

    hr = DoStart(pWriter, JSON_TOKEN_OBJECT_START, L"{");
    ExitOnFailure(hr, "Failed to start JSON object.");

LExit:
    return hr;
}
Пример #14
0
/*
void TrackerRequesterImpl::Start(UINT count, const TRACKER_LOGIN_ADDRESS addrs[])
{
	DoStart(count, addrs);
	if (!m_KeepRunningTimer.IsStarted())
	{
		m_KeepRunningTimer.Start(this, m_KeepRunningInterval);
	}
}
*/
void TrackerRequesterImpl::Start( TrackerRequesterListener& listener, size_t count, const TRACKER_LOGIN_ADDRESS addrs[], boost::shared_ptr<PeerInformation> peerInformation, boost::shared_ptr<TrackerPacketSender> packetSender )
{
	LIVE_ASSERT(!m_isStarted);
	m_listener = &listener;
	m_PeerInformation = peerInformation;
	m_PacketSender = packetSender;
	DoStart(count, addrs);
	if (false == m_KeepRunningTimer.is_started())
	{
		m_KeepRunningTimer.start(m_KeepRunningInterval);
	}
}
Пример #15
0
extern BOOLEAN I2C_GetAck(void)
{
   TCHAR ch;
   BOOLEAN ack;

   /* do start bit */
   DoStart();   
   ack = SendByteAck(I2C_device+1); /* send device address -- read mode */
   ch = ReceiveByte();				/* receive current address */
   Stop();							/* output stop bit */
   return ack;
} /* end GetAck() */
Пример #16
0
DAPI_(HRESULT) JsonWriteArrayStart(
    __in JSON_WRITER* pWriter
    )
{
    HRESULT hr = S_OK;

    hr = DoStart(pWriter, JSON_TOKEN_ARRAY_START, L"[");
    ExitOnFailure(hr, "Failed to start JSON array.");

LExit:
    return hr;
}
Пример #17
0
extern TCHAR I2C_Get(LONGINT adr)
{
   TCHAR ch;
	
   Start(I2C_device, adr);	/* output start bit and device address */
   
   /* do start bit */
   DoStart();     
   SendByteAck(I2C_device+1);	/* send device address -- read mode */
   ch = ReceiveByte();		/* receive byte */
   Stop();			/* output stop bit */
   return ch;
} /* end Get() */
Пример #18
0
//-------------------------------------------------------------------------------
//
//	PluginMain
//	
//	All calls to the plug in module come through this routine.
//
//	Inputs:
//		const int16 selector		Host provides selector indicating what
//									command to do.
//
//	Inputs and Outputs:
//		FilterRecord *filterRecord	Host provides a pointer to parameter block
//									containing pertinent data and callbacks.
//									See PIFilter.h
//
//		intptr_t *data				Use this to store a handle or pointer to our global
//									data structure, which is maintained by the
//									host between calls to the plug in.
//
//	Outputs:
//		int16 *result				Returns error result. Some errors are handled
//									by the host, some are silent, and some you
//									must handle. See PIGeneral.h.
//
//-------------------------------------------------------------------------------
DLLExport MACPASCAL void PluginMain(const int16 selector,
								    FilterRecordPtr filterRecord,
								    intptr_t * data,
								    int16 * result)
{
	// update our global parameters
	gFilterRecord = filterRecord;
	gDataHandle = data;
	gResult = result;

	if (selector == filterSelectorAbout)
	{
		sSPBasic = ((AboutRecord*)gFilterRecord)->sSPBasic;
	}
	else
	{
		sSPBasic = gFilterRecord->sSPBasic;

		if (gFilterRecord->bigDocumentData != NULL)
			gFilterRecord->bigDocumentData->PluginUsing32BitCoordinates = true;
	}

	// do the command according to the selector
	switch (selector)
	{
		case filterSelectorAbout:
			DoAbout();
			break;
		case filterSelectorParameters:
			DoParameters();
			break;
		case filterSelectorPrepare:
			DoPrepare();
			break;
		case filterSelectorStart:
			DoStart();
			break;
		case filterSelectorContinue:
			DoContinue();
			break;
		case filterSelectorFinish:
			DoFinish();
			break;
		default:
			break;
	}
	
	// unlock our handles used by gData and gParams
	if (selector != filterSelectorAbout)
		UnlockHandles();
}
Пример #19
0
void wxMotifTimerImpl::Notify()
{
    if ( IsOneShot() )
    {
        // nothing to do, timeout is removed automatically by X
        m_id = 0;
    }
    else // rearm the timer
    {
        DoStart();
    }

    wxTimerImpl::Notify();
}
Пример #20
0
EXPORT_C void CApaFsMonitor::Start(TNotifyType aNotifyType)
/** Sets the type of notification required and starts a file system notification
active object for each location being monitored.

You can either request notification of changes to all files in the file system, 
or to specific files, depending on the aLocation parameter specified in the NewL() 
function.

@param aNotifyType A set of flags that indicate what kinds of change should cause 
notifications. */
	{
	iNotifyType=aNotifyType;

	DoStart();
	}
Пример #21
0
extern void I2C_GetBuf(LONGINT adr, TCHAR buf[], CARDINAL size)
{
   CARDINAL ind;
   
   Start(I2C_device, adr);	/* output start bit and device address */
   
   /* do start bit again */
   DoStart();     
   SendByteAck(I2C_device+1);
   for (ind=0; ind<size-1; ind++) {
      buf[ind] = ReceiveByteAck(); /* receive data buffer */
   } /* end for */
   buf[size-1] = ReceiveByte();
   Stop();
} /* end GetBuf() */
Пример #22
0
void TDumpJob::DoNotSaved(TCmdTransceiver &Tr, TErrList *pErr)
{
    switch (JobState) {
    case jsStart:
        DoStart(Tr, pErr);
        break;

    case jsReadSysMem:
        DoReadingSysMem(Tr, pErr);
        break;

    case jsReadBckMem:
        DoReadingBckMem(Tr, pErr);
        break;
    }
}
Пример #23
0
DLLExport SPAPI void PluginMain(const int16 selector,
								FilterRecordPtr filterRecord,
								intptr_t * data,
								int16 * result)
{
	gData = data;
	gResult = result;
	
	if (selector == filterSelectorAbout)
	{
		sSPBasic = ((AboutRecordPtr)filterRecord)->sSPBasic;
	} 
	else 
	{
		gFilterRecord = filterRecord;
		sSPBasic = gFilterRecord->sSPBasic;

		if (gFilterRecord->bigDocumentData != NULL)
			gFilterRecord->bigDocumentData->PluginUsing32BitCoordinates = true;
	}

	switch (selector)
	{
		case filterSelectorAbout:
			DoAbout();
			break;
		case filterSelectorParameters:
			DoParameters();
			break;
		case filterSelectorPrepare:
			DoPrepare();
			break;
		case filterSelectorStart:
			DoStart();
			break;
		case filterSelectorContinue:
			DoContinue();
			break;
		case filterSelectorFinish:
			DoFinish();
			break;
		default:
			*gResult = filterBadParameters;
			break;
	}
}
Пример #24
0
    void ResourceSelector::Start()
    {
        std::string channels_list,channels_visit_frequency_list;

        framework::configure::Config conf("LiveMediaServiceTestClient.conf");
        conf.register_module("LiveChannel")
            << CONFIG_PARAM_NAME_RDONLY("channels", channels_list)
            << CONFIG_PARAM_NAME_RDONLY("channels_visit_frequency", channels_visit_frequency_list);

        boost::algorithm::split(channels_, channels_list, boost::algorithm::is_any_of(","));
        std::vector<std::string> channels_visit_frequency_values;
        boost::algorithm::split(channels_visit_frequency_values, channels_visit_frequency_list, boost::algorithm::is_any_of(","));

        if (channels_visit_frequency_values.size() > channels_.size())
        {
            std::cout<<"bad channel/channel_visit_frequency value"<<std::endl;
            exit(-1);
        }

        size_t sum = 0;
        for(size_t i = 0; i < channels_visit_frequency_values.size(); ++i)
        {

            size_t frequency = boost::lexical_cast<size_t>(channels_visit_frequency_values[i]);
            channels_visit_frequency_.push_back(frequency);
            sum += frequency;
        }

        if (sum > 100)
        {
            std::cout<<"bad channel_visit_frequency value"<<std::endl;
            exit(-1);
        }

        if (channels_visit_frequency_values.size() < channels_.size())
        {
            size_t average_frequency_for_non_specified = (100-sum)/(channels_.size() - channels_visit_frequency_values.size());
            while(channels_visit_frequency_.size() < channels_.size())
            {
                channels_visit_frequency_.push_back(average_frequency_for_non_specified);
            }
        }

        DoStart();    
    }
Пример #25
0
void TlbbScript::Start()
{
	if(!m_start)
	{
		m_start = true;
		m_timerCount = 0;
		// TODO: 这里是TlbbInstance的成员,要重新整理一下
		m_hWnd = GetForegroundWindow();
		m_hDC = GetDC(m_hWnd);
		Beep(987, 100);
		DoStart();
	}
	else
	{
		m_timerCount = 0;
		Beep(987, 100);
		DoReload();
	}
}
Пример #26
0
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;

	switch (message)
	{
	case WM_COMMAND:
		wmId    = LOWORD(wParam);
		wmEvent = HIWORD(wParam);
		switch (wmId)
		{
		case 1:
			DoStart(hWnd);
			break;
		case 2:
			DoStop(hWnd);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
		break;
	case WM_TIMER:
		DoTimer(hWnd);
		break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
		DoPaint(hdc);
		EndPaint(hWnd, &ps);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}
		//-----------------------------------------------------------------------------
		StateObject::OpertionResponse StateObject::Start()
		{
			Dia::Core::Log::OutputVaradicLine("Starting %s", GetUniqueId().AsChar());

			DIA_ASSERT(mState == StateEnum::kNotRunning, "Starting %s but in wrong state: %s", mUniqueId.AsChar(), mState.AsString() );

			mStartMutex.lock();
			OpertionResponse response = DoStart();

			switch (response)
			{
			case StateObject::OpertionResponse::kImmediate:
				mState = StateEnum::kRunning;
				break;
			case StateObject::OpertionResponse::kAsync:
				mState = StateEnum::kFlaggedToStart;
				break;
			default: DIA_ASSERT(0, "Cannot handle this response: %s", response.AsString());
				break;
			}
			mStartMutex.unlock();

			return response;
		}
Пример #28
0
DLLExport MACPASCAL void PluginMain (const int16 selector,
						             FilterRecordPtr filterParamBlock,
						             intptr_t *data,
						             int16 *result)
{
	//---------------------------------------------------------------------------
	//	(1) Check for about box request.
	//
	// 	The about box is a special request; the parameter block is not filled
	// 	out, none of the callbacks or standard data is available.  Instead,
	// 	the parameter block points to an AboutRecord, which is used
	// 	on Windows.
	//---------------------------------------------------------------------------

	if (selector == filterSelectorAbout)
	{
		sSPBasic = ((AboutRecordPtr)filterParamBlock)->sSPBasic;
		DoAbout((AboutRecordPtr)filterParamBlock);
	}
	else
	{ // do the rest of the process as normal:

		sSPBasic = ((FilterRecordPtr)filterParamBlock)->sSPBasic;

		Ptr globalPtr = NULL;		// Pointer for global structure
		GPtr globals = NULL; 		// actual globals

		//-----------------------------------------------------------------------
		//	(2) Allocate and initalize globals.
		//
		// 	AllocateGlobals requires the pointer to result, the pointer to the
		// 	parameter block, a pointer to the handle procs, the size of our local
		// 	"Globals" structure, a pointer to the long *data, a Function
		// 	Proc (FProcP) to the InitGlobals routine.  It automatically sets-up,
		// 	initializes the globals (if necessary), results result to 0, and
		// 	returns with a valid pointer to the locked globals handle or NULL.
		//-----------------------------------------------------------------------
		
		globalPtr = AllocateGlobals (result,
									 filterParamBlock,
									 filterParamBlock->handleProcs,
									 sizeof(Globals),
						 			 data,
						 			 InitGlobals);
		
		if (globalPtr == NULL)
		{ // Something bad happened if we couldn't allocate our pointer.
		  // Fortunately, everything's already been cleaned up,
		  // so all we have to do is report an error.
		  
		  *result = memFullErr;
		  return;
		}
		
		// Get our "globals" variable assigned as a Global Pointer struct with the
		// data we've returned:
		globals = (GPtr)globalPtr;

		//-----------------------------------------------------------------------
		//	(3) Dispatch selector.
		//-----------------------------------------------------------------------

		switch (selector)
		{
			case filterSelectorParameters:
				DoParameters(globals);
				break;
			case filterSelectorPrepare:
				DoPrepare(globals);
				break;
			case filterSelectorStart:
				DoStart(globals);
				break;
			case filterSelectorContinue:
				DoContinue(globals);
				break;
			case filterSelectorFinish:
				DoFinish(globals);
				break;
		}
	
		//-----------------------------------------------------------------------
		//	(4) Unlock data, and exit resource.
		//
		//	Result is automatically returned in *result, which is
		//	pointed to by gResult.
		//-----------------------------------------------------------------------	
		
		// unlock handle pointing to parameter block and data so it can move
		// if memory gets shuffled:
		if (*data != 0 /* NULL */ )
			PIUnlockHandle((Handle)*data);
	
	} // about selector special		
	
} // end PluginMain
EXPORT_C void CApaAppInstallationMonitor::Start()
{
    DoStart();
}
Пример #30
0
bool AbstractHttpServer::Start() {
  const bool started = DoStart(FLAGS_leopard_listening_ports);

  return started;
}