mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 06:30:35 +08:00
POSIX: px4_getpid() fix
Since the PX4 code uses both px4_task and pthread APIs, px4_getpid() must be save to call from either context. On posix, this means we have to always return the pthread ID. Reverted simulator change of pthread to px4_task There may have been side effects if this was build for a target that has process/task scoped file descriptors. It is now safe to call px4_getpid() from this pthread context with this change for the posix build for px4_getpid(). Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -114,7 +114,7 @@ private:
|
||||
uint8_t *_data; /**< allocated object buffer */
|
||||
hrt_abstime _last_update; /**< time the object was last updated */
|
||||
volatile unsigned _generation; /**< object generation count */
|
||||
pid_t _publisher; /**< if nonzero, current publisher */
|
||||
unsigned long _publisher; /**< if nonzero, current publisher */
|
||||
const int _priority; /**< priority of topic */
|
||||
|
||||
SubscriberData *filp_to_sd(device::file_t *filp);
|
||||
|
||||
Reference in New Issue
Block a user