本文整理汇总了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;
}
示例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);
}
示例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);
}
}
示例4: __cleanupselect
void __cleanupselect(void)
{
if (_treq) {
DeleteIORequest(_treq); _treq=NULL;
}
if (_tport) {
DeleteMsgPort(_tport); _tport=NULL;
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例14: cleanup
void
cleanup( int rc )
{
if( AHIDevice == 0 )
{
CloseDevice( (struct IORequest *) AHIio );
}
DeleteIORequest( (struct IORequest *) AHIio);
DeleteMsgPort( AHImp );
exit( rc );
}
示例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;
}