[Bug 194280] pthread_cleanup_push, pthread_cleanup_pop manual pages are missing critical usage information.

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Oct 18 11:08:39 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194280

John Baldwin <jhb at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Triage                |In Discussion
                 CC|                            |jhb at FreeBSD.org

--- Comment #2 from John Baldwin <jhb at FreeBSD.org> ---
I went with language similar to that of POSIX:

     The pthread_cleanup_push() function is implemented as a macro that opens
     a new block.  Invocations of this function must appear as standalone
     statements that are paired with a later call of pthread_cleanup_pop(3) in
     the same lexical scope.

for push and

     The pthread_cleanup_push() function is implemented as a macro that closes
     a block.  Invocations of this function must appear as standalone state-
     ments that are paired with an earlier call of pthread_cleanup_push(3) in
     the same lexical scope.

"same lexical scope" already implies same code block in same function.  I don't
know that we need to explicitly call out the that using the API incorrectly
will result in compile errors.  The same is true of any number of other APIs
(e.g. trying to pass a pointer to the getchar() or putchar() "functions" (which
are also macros).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-doc mailing list