I am trying to implement a mutual exclusion with OIL , i read that i have to use RESOURCE and its predefined APIs (DeclareResource(); GetResource(); ReleaseResource(); ) to protect critical sections.
i have declared my resource as follow :
conf.oil file :
Code: Select all
 RESOURCE mymutex { RESOURCEPROPERTY = STANDARD; }; Code: Select all
	TASK TaskReceive {
		PRIORITY = 0x01;   /* High priority */
		AUTOSTART = FALSE;
		STACK = SHARED;
		ACTIVATION = 1;    /* only one pending activation */
		SCHEDULE = FULL;
		RESOURCE = mymutex ;
	};Code: Select all
DeclareResource(mymutex);is there any missing part in the RESOURCE declaration ? and what makes DeclareResource() showing the error above ?make all
Using erika files in /home/evidence/Erika_SVN/
CC code.c
In file included from /home/evidence/Erika_SVN//pkg/ee.h:50:0,
from code.c:41:
./eecfg.h:23:21: error: expected declaration specifiers or '...' before numeric constant
#define mymutex 1U
^
code.c:77:17: note: in expansion of macro 'mymutex'
DeclareResource(mymutex);
^
make: *** [obj/code.o] Error 1
ps : Many thanks in advance for your help, i am a beginner.