Hi
I run a program using the vxworks skin from user space. As did hang, I
typed "Ctrl-C" to end the program.
Looking at /proc/xenomai/registry/vxworks/semaphores/ I remarked however, that
there were still vxworks semaphores open, which had not been deleted.
Is it up to the programmer to clean up at exit? Or is this a bug in the
current Xenomai implementation?
My test program looks like this:
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "vxworks/vxworks.h"
extern "C" int root_thread_init();
extern "C" void root_thread_exit(void);
int main (int argc, char *argv[])
{
int tid;
mlockall(MCL_CURRENT|MCL_FUTURE);
atexit(&root_thread_exit);
tid = taskSpawn("root", 10, 0, 32*1024, (FUNCPTR) root_thread_init,
1,2,3,4,5,6,7,8,9,10);
if (tid > 0) pause();
return 1;
}
extern "C" void root_thread_exit(void)
{
printf("%s: task %d\n", __FUNCTION__, taskIdSelf());
}
extern "C" int root_thread_init()
{ const char* arg="";
const char* argv[2];
argv[0] = "undefined";
argv[1] = arg;
int argc = sizeof(argv) / sizeof(char*);
int semId1 = semCCreate(SEM_Q_PRIORITY, 3);
int semId3 = semMCreate(SEM_Q_PRIORITY | SEM_INVERSION_SAFE );
printf("proc %s: task %d %s \n", __FUNCTION__, taskIdSelf(),
taskName(taskIdSelf()));
taskDelay(sysClkRateGet());
printf("proc %s: task %d shutting down\n", __FUNCTION__, taskIdSelf());
// return 0;
exit(0);
}
Best regards
--
Niklaus Giger
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help