position of task variable codes

Joe Black joe_black at myrealbox.com
Sat Apr 13 02:38:47 UTC 2002

	Hi, all

	Dose the position of rtems_task_variable_add must be in the task?


	my case:
		in init_task
		create task1
		call rtems_task_variable_add to add task1's variable
		start task1

		create task2 (with the same priority of task1)
		call rtems_task_variable_add to add task2's variable
		start task2

		delete init_task and task1 run

		printf task1's variable

		suspend task1 and task2 run

		printf task2's variable

		resume task1 

		suspend task2 and task1 run

		in task1, printf its variable, it failed :(

		resume task2 and suspend task1

		in task2, printf its variable, failed too


	I can guarantee the parameters passed to rtems_task_variable_add are OK in the case above.
	If I put the rtems_task_variable_add in task1 or task2, it works well
	Could anyone tell me how I can resolve the problem? 3x.

 Joe Black
 2002-04-13 10:13:52

More information about the users mailing list