2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <aros/libcall.h>
10 #include <exec/ports.h>
11 #include <proto/exec.h>
13 #include "exec_intern.h"
14 #include "exec_util.h"
16 /*****************************************************************************
20 AROS_LH1(void, ReplyMsg
,
23 AROS_LHA(struct Message
*, message
, A1
),
26 struct ExecBase
*, SysBase
, 63, Exec
)
29 Send a message back to where it came from. It's generally not
30 wise to access the fields of a message after it has been replied.
33 message - a message got with GetMsg().
44 WaitPort(), GetMsg(), PutMsg()
48 ******************************************************************************/
54 /* handle FASTCALL before doing locking or anything else. yes, there's a
55 * potential race here if some task was to change mn_ReplyPort before/as
56 * we read it. thats why we fetch it again further down, after Disable().
57 * all bets are of when using FASTCALL */
58 port
= message
->mn_ReplyPort
;
60 if (port
!= NULL
&& port
->mp_Flags
& PA_FASTCALL
)
62 FastPutMsg(port
, message
, SysBase
);
66 /* Protect the message against access by other tasks. */
70 port
=message
->mn_ReplyPort
;
72 /* Not set? Only mark the message as no longer sent. */
74 message
->mn_Node
.ln_Type
=NT_FREEMSG
;
77 /* Mark the message as replied */
78 message
->mn_Node
.ln_Type
=NT_REPLYMSG
;
80 InternalPutMsg(port
, message
, SysBase
);