Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Direct, thread-safe, access to thread managed object #9750

Closed
wants to merge 3 commits into from

Conversation

ivovandongen
Copy link
Contributor

@ivovandongen ivovandongen commented Aug 10, 2017

This pr enables a thread to be suspended and the managed object to be accessed directly.

  • Exposes thread.hpp
  • Makes thread suspending/resuming thread safe so it can be called from arbitrary threads
  • Adds a RAII class that blocks a thread and gives access to the object managed by it (BlockingThreadGuard)

Needed for:

@ivovandongen ivovandongen requested a review from tmpsantos August 10, 2017 13:33
@ivovandongen ivovandongen mentioned this pull request Aug 10, 2017
6 tasks
@ivovandongen ivovandongen self-assigned this Aug 10, 2017
@ivovandongen ivovandongen added the Core The cross-platform C++ core, aka mbgl label Aug 10, 2017
@jfirebaugh
Copy link
Contributor

Makes thread suspending/resuming thread safe so it can be called from arbitrary threads

It doesn't look thread safe to me; there's even an assert(!paused) that will fail if a second thread tries to pause an already-paused thread.

@ivovandongen ivovandongen force-pushed the ivd-direct-actor-access branch from e57742a to bfac9b6 Compare August 15, 2017 10:34
@ivovandongen
Copy link
Contributor Author

It doesn't look thread safe to me; there's even an assert(!paused) that will fail if a second thread tries to pause an already-paused thread.

Right. It was definitely missing some pieces. I've fixed up the pause/resume methods and added tests.

@jfirebaugh
Copy link
Contributor

@ivovandongen This is no longer needed, correct?

@jfirebaugh jfirebaugh deleted the ivd-direct-actor-access branch July 27, 2018 22:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants