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


C++ DeleteMsgPort函数代码示例

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


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

示例1: IPC_PutMsg

BOOL IPC_PutMsg( struct MsgPort *destino, IPCACT_T action, APTR udata )
{
	struct MsgPort *replyport = NULL;
	BOOL error = TRUE;
	
	ENTER();
	DBG_POINTER(destino);
	
	if(destino && (replyport = CreateMsgPort()))
	{
		struct IPCMsg ipcmsg;
		APTR xMsg;
		
		ipcmsg.ipc_msg.mn_ReplyPort	= replyport;
		ipcmsg.ipc_msg.mn_Length	= sizeof(struct IPCMsg);
		ipcmsg.ipc_ID			= IPC_MAGIC;
		ipcmsg.ipc_action		= action;
		ipcmsg.ipc_result		= IPCR_ABORTED;
		ipcmsg.ipc_data			= udata;
		
		DBG("Sending action '%ld' from %lx to %lx\n", action, replyport, destino);
		
		Forbid();
		PutMsg( destino, &ipcmsg.ipc_msg);
		WaitPort(replyport);
		while((xMsg = GetMsg( replyport )))
		{
			DBG("Got reply...\n");
			
			switch(((struct IPCMsg *)xMsg)->ipc_result)
			{ // TODO
				case IPCR_ABORTED:
					DBG("IPCR_ABORTED\n");
					break;
				
				case IPCR_FAIL:
					DBG("IPCR_FAIL\n");
					break;
				
				case IPCR_OK:
					DBG("IPCR_OK\n");
					break;
				default:
					break;
			}
		}
		Permit();
		
		DeleteMsgPort(replyport);
		
		error = FALSE;
	}
	
	LEAVE();
	
	return !error;
}
开发者ID:diegocr,项目名称:AmiNZB,代码行数:57,代码来源:ipc.c

示例2: cleanup

void cleanup(LONG rc)
{
  if(!AHIDevice)
    CloseDevice((struct IORequest *)AHIio);
  DeleteIORequest((struct IORequest *)AHIio);
  FreeMem(AHIiocopy,sizeof(struct AHIRequest));
  DeleteMsgPort(AHImp);
  exit(rc);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:9,代码来源:PlayTest.c

示例3: sdcard_CloseTimer

void sdcard_CloseTimer(struct IORequest *tmr)
{
    if (NULL != tmr)
    {
	struct MsgPort *p = tmr->io_Message.mn_ReplyPort;
	CloseDevice(tmr);
	DeleteIORequest(tmr);
	DeleteMsgPort(p);
    }
}
开发者ID:michalsc,项目名称:AROS,代码行数:10,代码来源:timer.c

示例4: __cleanupselect

void __cleanupselect(void)
{
  if (_treq) {
    DeleteIORequest(_treq); _treq=NULL;
  }

  if (_tport) {
    DeleteMsgPort(_tport); _tport=NULL;
  }
}
开发者ID:Peruonto,项目名称:HXCFE_Amiga_file_selector,代码行数:10,代码来源:select.c

示例5: Sys_Thread_DeleteThread

void Sys_Thread_DeleteThread(struct SysThread *thread)
{
	SetTaskPri(&thread->process->pr_Task, 0);

	while(!GetMsg(thread->msgport))
		WaitPort(thread->msgport);

	DeleteMsgPort(thread->msgport);
	FreeVec(thread);
}
开发者ID:classicQ,项目名称:classicQ.github.io,代码行数:10,代码来源:thread_aros.c

示例6: closeBlockDevice

void closeBlockDevice(struct AFSBase *afsbase, struct IOHandle *ioh) {

	remChangeInt(afsbase, ioh);
	if (ioh->iochangeint != NULL)
		closeDevice(afsbase, ioh->iochangeint);
	if (ioh->ioreq != NULL)
		closeDevice(afsbase, ioh->ioreq);
	if (ioh->mp != NULL)
		DeleteMsgPort(ioh->mp);
}
开发者ID:michalsc,项目名称:AROS,代码行数:10,代码来源:os_aros_support.c

示例7: handler

void SAVEDS handler(void)
{
  struct Process *me = (struct Process *)FindTask(NULL);
  struct startMsg *smsg;
  struct MsgPort *port;
  BOOL res = FALSE;

  ENTER();

  WaitPort(&me->pr_MsgPort);
  smsg = (struct startMsg *)GetMsg(&me->pr_MsgPort);

  #if defined(__amigaos4__)
  port = AllocSysObject(ASOT_PORT, TAG_DONE);
  #else
  port = CreateMsgPort();
  #endif

  if(port != NULL)
    res = localSendRexxMsg(port, smsg->port, smsg->cmd);

  smsg->res = res;
  ReplyMsg((struct Message *)smsg);

  if(res == TRUE)
  {
    struct RexxMsg *rxmsg;

    WaitPort(port);
    rxmsg = (struct RexxMsg *)GetMsg(port);

    DeleteArgstring((APTR)rxmsg->rm_Args[0]);
    DeleteRexxMsg(rxmsg);
  }

  if(port != NULL)
  {
    #if defined(__amigaos4__)
    FreeSysObject(ASOT_PORT, port);
    #else
    DeleteMsgPort(port);
    #endif
  }

  ObtainSemaphore(&OpenURLBase->libSem);
  OpenURLBase->rexx_use--;
  ReleaseSemaphore(&OpenURLBase->libSem);

  #if !defined(__amigaos4__)
  // all systems except OS4 should leave this function in forbidden state
  Forbid();
  #endif

  LEAVE();
}
开发者ID:michalsc,项目名称:AROS,代码行数:55,代码来源:handler.c

示例8: cleanup

void cleanup(int kod,char *text)
{
    shutdownnode(NODSER);
    CloseIO();
    if(NiKwind) CloseWindow(NiKwind);
    if(RexxSysBase) CloseLibrary((struct Library *)RexxSysBase);
    if(nikomnodeport) {
        RemPort(nikomnodeport);
        DeleteMsgPort(nikomnodeport);
    }
    if(rexxport) {
        RemPort(rexxport);
        DeleteMsgPort(rexxport);
    }
    if(NiKomBase) CloseLibrary(NiKomBase);
    if(UtilityBase) CloseLibrary(UtilityBase);
    if(IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
    printf("%s",text);
    exit(kod);
}
开发者ID:jayminer81,项目名称:NiKom,代码行数:20,代码来源:Ser.c

示例9: ai_exit

static void ai_exit(void)
{
    if (CTX != NULL) {
        AIN_DeleteContext(CTX);
        CTX = NULL;
    }
    if (ai_port != NULL) {
        DeleteMsgPort(ai_port);
        ai_port = NULL;
    }
}
开发者ID:AreaScout,项目名称:vice,代码行数:11,代码来源:joyai.c

示例10: HookRexxCommand

// Send an ARexx command
long __asm __saveds HookRexxCommand(
	register __a0 char *command,
	register __a1 char *result,
	register __d0 long length,
	register __a2 struct MsgPort *replyport,
	register __d1 ULONG flags)
{
	struct MsgPort *rexx,*reply;
	struct RexxMsg *msg;
	long rc=-1;

	// Clear result
	if (result) *result=0;

	// Get rexx port
	if (!GUI->rexx_proc || !(rexx=(struct MsgPort *)IPCDATA(GUI->rexx_proc)))
		return -1;

	// Create reply port if needed
	if ((reply=replyport) || (reply=CreateMsgPort()))
	{
		// Create message
		if (msg=BuildRexxMsgExTags(
					reply,
					".dopus5",
					rexx->mp_Node.ln_Name,
					RexxTag_Arg0,command,
					TAG_END))
		{
			// Initialise message
			msg->rm_Action|=1|RXCOMM;
			if (result) msg->rm_Action|=RXFF_RESULT;

			// Send the message and wait for reply
			PutMsg(rexx,(struct Message *)msg);
			WaitPort(reply);
			GetMsg(reply);

			// String reply?
			if (msg->rm_Result2 && result)
				stccpy(result,(char *)msg->rm_Result2,length);
			rc=msg->rm_Result1;

			// Free message
			FreeRexxMsgEx(msg);
		}

		// Free message port
		if (reply!=replyport) DeleteMsgPort(reply);
	}

	return rc;
}
开发者ID:MrZammler,项目名称:opus_magellan,代码行数:54,代码来源:callback_main.c

示例11: FreeRocket

void FreeRocket(struct NepClassRocket *nch)
{
    APTR pab;

    psdGetAttrs(PGA_DEVICE, nch->nch_Device,
                DA_Binding, &pab,
                TAG_END);
    psdReleaseAppBinding(pab);
    psdFreePipe(nch->nch_EP0Pipe);
    DeleteMsgPort(nch->nch_TaskMsgPort);
    psdFreeVec(nch);
}
开发者ID:michalsc,项目名称:AROS,代码行数:12,代码来源:RocketTool.c

示例12: CloseDevice

cdrom_interface::~cdrom_interface(void)
{
  if (cd_error == 0) {
    CloseDevice((struct IORequest *)CDIO);
  }
  if (CDIO != NULL) {
    DeleteIORequest((struct IORequest *)CDIO);
  }
  if (CDMP != NULL) {
    DeleteMsgPort(CDMP);
  }
}
开发者ID:iver6,项目名称:BA,代码行数:12,代码来源:cdrom_amigaos.cpp

示例13: arexx_cleanup

void arexx_cleanup(void)
{
	if (arexx_port)
	{
		RemPort(arexx_port);
		DeleteMsgPort(arexx_port);
	}

	while (arexx_execute_out)
	{
		struct RexxMsg *rxmsg;

		WaitPort(arexx_execute_port);
		while ((rxmsg = (struct RexxMsg *)GetMsg(arexx_execute_port)))
		{
			arexx_execute_out--;
			ClearRexxMsg(rxmsg,1);
			DeleteRexxMsg(rxmsg);
		}
	}
	if (arexx_execute_port) DeleteMsgPort(arexx_execute_port);
}
开发者ID:sba1,项目名称:simplemail,代码行数:22,代码来源:arexx.c

示例14: cleanup

void
cleanup( int rc )
{
  if( AHIDevice == 0 )
  {
    CloseDevice( (struct IORequest *) AHIio );
  }

  DeleteIORequest( (struct IORequest *) AHIio);
  DeleteMsgPort( AHImp );

  exit( rc );
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:13,代码来源:AddAudioModes.c

示例15: CleanUp

void CleanUp(void) {
  if(!AHIDevice)
    CloseDevice((struct IORequest *)AHIio);
  DeleteIORequest((struct IORequest *)AHIio);
  DeleteMsgPort(AHImp);

  AHIBase = NULL; AHImp = NULL; AHIio = NULL; AHIDevice = -1;

  CloseahiprefsCatalog();

  CloseLibrary(LocaleBase);
  LocaleBase = NULL;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:13,代码来源:support.c


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