Commit 23179862 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Remove generation of redundant functions (pro_)

parent a62f6508
......@@ -3,8 +3,16 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f then Ctrl-W-L (or gf)
@@-- in vim to open the doc: $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_pi.ascii
@@IF@@ @_EXIST:Remote_Function_Names_@
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@TABLE@@
@@-- Here all functions are protected or unprotected (attribute Kind) as we are in a block
@@-- However we may not need to generate a pro_ function if the original PI was sporadic or cyclic
@@-- because a similar code is generated in their thread directly (function call_ThreadName)
@@-- therefore we check first these properties before generating anything here
@@IF@@ @_IF_Property_Names_@ = Taste::RCMoperationKind and (@_IF_Property_Values_@ = protected or @_IF_Property_Values_@ = unprotected)
@@SET@@ Trigger = TRUE
@@END_IF@@
@@END_TABLE@@
@@IF@@ @_EXIST:Remote_Function_Names_@ and @_Trigger_@ = TRUE
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
void pro_@_Parent_Function_@_@_Name_@(void)
@@ELSE@@ @@-- contains param(s)
......@@ -19,7 +27,6 @@ void pro_@_Parent_Function_@_@_Name_@
@@END_TABLE@@
@@END_INLINE@@
@@END_IF@@
@@END_IF@@
{
extern process_package__taste_protected_object @_LOWER:Parent_Function_@_protected;
__po_hi_protected_lock (@_LOWER:Parent_Function_@_protected.protected_id);
......
......@@ -5,7 +5,8 @@
@@-- in vim to open the doc: $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_thread.ascii
#include "@_LOWER:Pro_Block_Name_@_vm_if.h"
@@INLINE()(\n)(\n)@@
// Function called by the middleware when task is ready to run
@@INLINE()(\n)(\n{)@@
@@IF@@ @_Param_Names'Length_@ > 0
@@TABLE@@
void call_@_LOWER:Thread_Name_@ (__po_hi_task_id sender_pid, dataview__@_REPLACE_ALL((-)/_):LOWER:Param_Types_@_buffer_impl buf)
......@@ -14,7 +15,6 @@
void call_@_LOWER:Thread_Name_@ (__po_hi_task_id sender_pid)
@@END_IF@@
@@END_INLINE@@
{
(void)sender_pid; // sender id is not used for now
@@IF@@ @_Need_Mutex_@
......
......@@ -3,6 +3,15 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f then Ctrl-W-L (or gf)
@@-- in vim to open the doc: $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_pi.ascii
@@TABLE@@
@@-- Here all functions are protected or unprotected (attribute Kind) as we are in a block
@@-- However we may not need to generate a pro_ function if the original PI was sporadic or cyclic
@@-- because a similar code is generated in their thread directly (function call_ThreadName)
@@-- therefore we check first these properties before generating anything here
@@IF@@ @_IF_Property_Names_@ = Taste::RCMoperationKind and (@_IF_Property_Values_@ = protected or @_IF_Property_Values_@ = unprotected)
@@SET@@ Trigger = TRUE
@@END_IF@@
@@END_TABLE@@
@@MACRO(PARAMETERS)@@
@@IF@@ @_Param_Names'Length_@ = 0
void
......@@ -18,7 +27,7 @@
@@END_INLINE@@
@@END_IF@@
@@END_MACRO@@
@@IF@@ @_Kind_@ = PROTECTED_OPERATION and @_EXIST:Remote_Function_Names_@
@@IF@@ @_Kind_@ = PROTECTED_OPERATION and @_EXIST:Remote_Function_Names_@ and @_Trigger_@ = TRUE
@@-- Check that there is a caller, otherwise don't generate anything (e.g. cyclic)
extern void @_LOWER:Parent_Function_@_@_Name_@(@_STRIP:PARAMETERS()_@);
void pro_@_Parent_Function_@_@_Name_@(@_STRIP:PARAMETERS()_@);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment