[riot-commits] [RIOT-OS/RIOT] b54962: posix: Add pthread_cleanup handlers

Oleg Hahm oleg at hobbykeller.org
Wed Apr 9 00:19:20 CEST 2014


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: b54962689a9ba8c2b06e7b693099df715e1cd70e
      https://github.com/RIOT-OS/RIOT/commit/b54962689a9ba8c2b06e7b693099df715e1cd70e
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2014-04-04 (Fri, 04 Apr 2014)

  Changed paths:
    M sys/posix/pthread/include/pthread.h
    M sys/posix/pthread/include/pthreadtypes.h
    M sys/posix/pthread/pthread.c
    A tests/test_pthread_cleanup/Makefile
    A tests/test_pthread_cleanup/main.c
    A tests/test_pthread_cleanup/tests/01-test

  Log Message:
  -----------
  posix: Add pthread_cleanup handlers

With `pthread_cleanup_(push|pop)` you can define a function that should
be ran if the thread is exited while it is inside this scope. A thread
can be ended here through an explicit call to `pthread_exit()`, or if
cancellation was requested and a cancellation point was hit.

`pthread_cleanup_*` is mostly only useful together with cancellation
points, and cancellation points are only useful with a cleanup
functionality. Cancellation points are at least partially implemented by
means of `pthread_testcancel()`.

C.f. ["Cancellation Points"][1].

  [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_05_02


  Commit: b44b88a6edd0201678e10d6673803e47d755e800
      https://github.com/RIOT-OS/RIOT/commit/b44b88a6edd0201678e10d6673803e47d755e800
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2014-04-04 (Fri, 04 Apr 2014)

  Changed paths:
    M sys/posix/pthread/include/pthread.h
    A sys/posix/pthread/include/pthread_cleanup.h
    M sys/posix/pthread/include/pthreadtypes.h

  Log Message:
  -----------
  pthread_cleanup: better documentation


  Commit: 74804ab979efa72c4a2cfb88bd7534ceca7db818
      https://github.com/RIOT-OS/RIOT/commit/74804ab979efa72c4a2cfb88bd7534ceca7db818
  Author: René Kijewski <rene.kijewski at fu-berlin.de>
  Date:   2014-04-04 (Fri, 04 Apr 2014)

  Changed paths:
    M tests/test_pthread_cleanup/Makefile

  Log Message:
  -----------
  pthread_cleanup: fixup for #798


  Commit: 8a86f493b46a21e5e01de5ae09940335c3f2996f
      https://github.com/RIOT-OS/RIOT/commit/8a86f493b46a21e5e01de5ae09940335c3f2996f
  Author: Oleg Hahm <oleg at hobbykeller.org>
  Date:   2014-04-09 (Wed, 09 Apr 2014)

  Changed paths:
    M sys/posix/pthread/include/pthread.h
    A sys/posix/pthread/include/pthread_cleanup.h
    M sys/posix/pthread/pthread.c
    A tests/test_pthread_cleanup/Makefile
    A tests/test_pthread_cleanup/main.c
    A tests/test_pthread_cleanup/tests/01-test

  Log Message:
  -----------
  Merge pull request #821 from Kijewski/pthrad_cleanup

posix: Add pthread_cleanup handlers


Compare: https://github.com/RIOT-OS/RIOT/compare/786cd0a5f7b9...8a86f493b46a


More information about the commits mailing list