All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] rt_queue_delete returns -EBUSY
@ 2008-08-25 15:43 Petr Cervenka
  2008-08-25 16:24 ` Philippe Gerum
  2008-08-25 16:51 ` Philippe Gerum
  0 siblings, 2 replies; 13+ messages in thread
From: Petr Cervenka @ 2008-08-25 15:43 UTC (permalink / raw)
  To: xenomai

Hello,
I tried xenomai 2.4.5, hoping that my problems with real-time queue will disappear. But there is another (perhaps very trivial) error.
Function call rt_queue_delete always returns -EBUSY (at least for me). You don't have to bind it from another task or use it at all.
I hope that I have used it in the right way.
Petr Cervenka

Simple example:

#include <stdlib.h>

#include <sys/mman.h>       // mlockall
#include <native/task.h>
#include <native/queue.h>

RT_TASK  main_task;
RT_QUEUE queue;

int main(int argc, char** argv) {
    int res;
    
    mlockall(MCL_CURRENT | MCL_FUTURE);
    
    res = rt_task_shadow(&main_task, "MAIN_TASK", 5, T_FPU);
    if (res < 0) {
        fprintf(stderr, "rt_task_shadow() failed: %d (%s)\n", res, strerror(-res));
        goto cleanup_end;
    }
    
    res = rt_queue_create(&queue, "QUEUE", 1024, Q_UNLIMITED, Q_FIFO | Q_SHARED);
    if (res < 0) {
        fprintf(stderr, "rt_queue_create() failed: %d (%s)\n", res, strerror(-res));
        goto cleanup_task;
    }
    
cleanup_queue:
    res = rt_queue_delete(&queue);
    if (res < 0) {
        fprintf(stderr, "rt_queue_delete() failed: %d (%s)\n", res, strerror(-res));
    }
cleanup_task:
cleanup_end:
    return res;
} 



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

end of thread, other threads:[~2008-09-21  9:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-25 15:43 [Xenomai-help] rt_queue_delete returns -EBUSY Petr Cervenka
2008-08-25 16:24 ` Philippe Gerum
2008-09-04 16:04   ` Petr Cervenka
2008-09-04 21:46     ` Mark Saiia
2008-09-05  8:46       ` Gilles Chanteperdrix
2008-09-08 10:34         ` Philippe Gerum
2008-09-15 13:04           ` Petr Cervenka
2008-09-15 17:29             ` Philippe Gerum
2008-09-20 10:19               ` Paul
2008-09-20 13:54                 ` Philippe Gerum
2008-09-21  9:09                 ` Gilles Chanteperdrix
2008-08-25 16:51 ` Philippe Gerum
     [not found]   ` <200808260929.2847@domain.hid>
     [not found]     ` <200808260935.5720@domain.hid>
2008-08-26  8:07       ` Petr Cervenka

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.