casaroli commented on code in PR #21066:
URL: https://github.com/apache/nuttx/pull/21066#discussion_r4398240847
##########
libs/libc/semaphore/sem_wait.c:
##########
@@ -220,9 +220,11 @@ int nxsem_wait(FAR sem_t *sem)
int nxsem_wait_uninterruptible(FAR sem_t *sem)
{
+ FAR struct tcb_s *rtcb = this_task();
Review Comment:
this_task() is private to sched/ (sched/sched/sched.h), so libc does not
build (CI sim-01: implicit declaration, then undefined reference at link).
Also, in user space of a protected or kernel build, this code cannot access the
TCB. The old macro was empty there, and the comment at
include/nuttx/semaphore.h:67 still says "Not in user space".
Fix: use nxsched_self() and keep the `#if defined(CONFIG_BUILD_FLAT) ||
defined(__KERNEL__)` guard (for example two set/restore macros in
include/nuttx/semaphore.h); the same at line 272.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]