Skip to content

dougvj/android_pthread_fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

android_pthread_fix

Missing pthread functionality on android with bionic, namely cancellation semantics.

Include the android_pthread_fix.c and android_pthread_fix.h in your project. This provides the following function calls:

  • pthread_getname_np (Exists in bionic but prototype missing)
  • pthread_cancel
  • pthread_setcancelstate
  • pthread_setcanceltype
  • pthread_testcancel

Limitations

  • Requires managing a separate table of thread information, which right now is hardcoded to size 512. This can be changed in the source file

  • Co-opts the use of SIGUSR1

  • Cancellation points are implemented with Macros, which means that if you have something like a function pointer struct field named send it will break. In addition, you need to be extra careful of include order if headers utilize cacellation point library functions.

Acknowledgements

Work sponsored by Subsurface Insights

About

Missing pthread functionality on android with bionic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages