This function allows the caller to specify the reference clock
and choose between absolute and relative mode. In relative mode,
the remaining time can be returned.
Details
- Reviewers
ed - Commits
- rS314179: Add sem_clockwait_np()
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 7544 Build 7698: arc lint + arc unit
Event Timeline
include/semaphore.h | ||
---|---|---|
62 | Hmmm... I'm not a fan of this. This means that if you include <semaphore.h> once without exposing this function, there is no way to get it later on. Saying: "just make sure to include stuff in the right order" won't work in practice. What if you make use of some kind of library that suddenly decides to start using semaphores in its header files from one version to the other? That will break the build in unforeseen ways. The only sensible thing is to use __clockid_t. | |
63 | What about calling this sem_clock_timedwait()? | |
63 | Correction: sem_clock_timedwait_np(). |
include/semaphore.h | ||
---|---|---|
62 | I completely agree. I pulled most of this from a commercial appliance and failed to revisit this part before uploading...even though I remembered it when I updated the man page! Thanks for catching it. | |
63 | I've been looking for a better name, too. I like your suggestion. How about sem_clockwait_np()? It's shorter, but it still describes the behavior well enough. It's also consistent with other functions like sem_timedwait and sem_trywait. |
include/semaphore.h | ||
---|---|---|
63 | Sounds good to me! |
- rename sem_timedwait5_np to sem_clockwait_np
- start adding unit tests for sem_timedwait() and sem_timedwait5_np()
Looks good to me, except that I don't know everything about umtx internals to judge whether those changes are all right. ;-)
lib/libc/gen/sem_timedwait.3 | ||
---|---|---|
153 | .Fx instead of FreeBSD, right? |