Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
E external_mosquitto
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cobalt
  • external_mosquitto
  • Wiki
  • Home

Last edited by Mark Stevens Oct 19, 2017
Page history

Home

Android port

Current Status: builds Android.mk has modules for libmosquitto mosquitto
config.mk is incorporated

  • pthread_cancel() replaced with pthread_kill( .., 0) : needs attn mosquitto_password.c needs to compile to separate exe

pthread_cancel() undefined in bionic
Backgrounder: https://groups.google.com/forum/#!topic/android-platform/Cq05PaLaZbE

the pthread support in Bionic is restricted to the set of things we needed to get the platform running. Except for a few exceptions, if something is not there, feel free to file a feature request or even better provide a patch for it.

NOTE: pthread_cancel() is part of the exceptions and is not going to be supported

Suggested fix:

Try changing your code so that your threads don't get stuck waiting indefinitely for i/o. For example used conditional variables, select or poll to wait for events, and be sure to create a 'stop-the-thread event'. That's how any properly written code should be anyway Another more rustic alternative is to either close/shutdown the file descriptor or resource the thread is waiting on, or even use pthread-kill to send a signal to the thread, since this sill make the system call return with EINTR (you need to unblock the signal first though)

In all cases, be sure to properly release resources when exiting thr thread. 99% of the code that uses pthread_cancel I have seen leaks memory, or even locks, in certain circumstances.

Clone repository
  • Home