Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » Timing of deleting instance from the internal queue
Timing of deleting instance from the internal queue [message #549808] Wed, 28 July 2010 05:05 Go to next message
Naoki Kawada is currently offline Naoki KawadaFriend
Messages: 10
Registered: June 2010
Junior Member
Hi

Please assume Mod is characterized by @InstanceFinalize.
If Mod_delete/destruct() is called for runtime-created module instance, Mod_Instance_finalize is called.

Now question is :
Is this true that the Mod_Instance_finalize() is always called after clearing the instance registration from the internal Mod instance queue, which it can be searched by the following loop.

-----------------------------------
«Mod»_Handle obj;

/* loop over all runtime created instances managed by «Mod» */
for (obj = «Mod»_Object_first(); obj != NULL; obj = «Mod»_Object_next(obj)) {
: /* use «Mod»_handle obj */
}

Regards,
-Kawada
Re: Timing of deleting instance from the internal queue [message #550503 is a reply to message #549808] Fri, 30 July 2010 14:37 Go to previous message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
Yes.

Mod_delete() eventually calls Core_deleteObject() which is defined in
the xdc.runtime package; see Core-mem.c. You can see from this function
that object deletion roughly proceeds as follows:
1. remove the instance from a its linked list
2. call the module's finalize function (if one is defined)
3. free up the memory of the instance object itself


On 7/27/2010 10:05 PM, Naoki Kawada wrote:
> Hi
>
> Please assume Mod is characterized by @InstanceFinalize.
> If Mod_delete/destruct() is called for runtime-created module instance,
> Mod_Instance_finalize is called.
>
> Now question is :
> Is this true that the Mod_Instance_finalize() is always called after
> clearing the instance registration from the internal Mod instance queue,
> which it can be searched by the following loop.
>
> -----------------------------------
> «Mod»_Handle obj;
>
> /* loop over all runtime created instances managed by «Mod» */
> for (obj = «Mod»_Object_first(); obj != NULL; obj =
> «Mod»_Object_next(obj)) {
> : /* use «Mod»_handle obj */
> }
>
> Regards,
> -Kawada
>
Previous Topic:Problem with Log_write generation
Next Topic:Release notification for XDCtools 3.20.02
Goto Forum:
  


Current Time: Sun Dec 21 22:17:53 GMT 2014

Powered by FUDForum. Page generated in 0.01628 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software