On 04/20/2017 04:58 AM, [email protected] wrote: > *I'm now manually memset task variable, but I still want to do it in > the xenomai library > to make more people less detours.
No, you are wrongly assuming that a task descriptor should still contain consistent data after a cancellation request is applied to it; such guarantee does not exist. This means that using rt_task_inquire() to figure out whether a task was deleted is wrong as well. A task descriptor is deemed consistent after a successful call to rt_task_create/spawn(), until that task exits, for whatever reason, voluntarily or not. The same goes with the POSIX nptl interface, which may recycle the memory which the pthread_t handle refers to at some point after a cancellation request is issued with this handle. That memory is managed into an internal cache, part of which may even be unmapped from the process's address space in order to shrink an overpopulated cache. Therefore, using a stale handle in requests would at best cause the process to crash when referring to invalid memory, or return inconsistent data pulled from reused memory. -- Philippe. _______________________________________________ Xenomai mailing list [email protected] https://xenomai.org/mailman/listinfo/xenomai
