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

Home · Changes

Page history
mstevens created page: home authored 7 years ago by Mark Stevens's avatar Mark Stevens
Hide whitespace changes
Inline Side-by-side
Showing with 22 additions and 0 deletions
+22 -0
  • home.md home.md +22 -0
  • No files found.
home.md
View page @ ba65516d
......@@ -6,3 +6,25 @@ config.mk is incorporated
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.
>>>
\ No newline at end of file
Clone repository
  • Home