All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Cleanup after using the vxWorks skin?
@ 2006-10-21 14:28 Niklaus Giger
  2006-10-21 14:52 ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Niklaus Giger @ 2006-10-21 14:28 UTC (permalink / raw)
  To: xenomai

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-21 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-21 14:28 [Xenomai-help] Cleanup after using the vxWorks skin? Niklaus Giger
2006-10-21 14:52 ` Philippe Gerum
2006-10-21 15:08   ` Niklaus Giger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.