Browse Source

Added some comments regarding MessageManagerLocks

tags/2021-05-28
jules 10 years ago
parent
commit
82b0a3628b
2 changed files with 5 additions and 0 deletions
  1. +3
    -0
      modules/juce_events/messages/juce_MessageManager.h
  2. +2
    -0
      modules/juce_opengl/opengl/juce_OpenGLRenderer.h

+ 3
- 0
modules/juce_events/messages/juce_MessageManager.h View File

@@ -243,6 +243,9 @@ private:
Obviously be careful not to create one of these and leave it lying around, or
your app will grind to a halt!
MessageManagerLocks are re-entrant, so can be safely nested if the current thread
already has the lock.
Another caveat is that using this in conjunction with other CriticalSections
can create lots of interesting ways of producing a deadlock! In particular, if
your message thread calls stopThread() for a thread that uses these locks,


+ 2
- 0
modules/juce_opengl/opengl/juce_OpenGLRenderer.h View File

@@ -50,6 +50,8 @@ public:
/** Called when you should render the next openGL frame.
Note that this callback will be made on a background thread, not the message
thread, so make sure that your implementation is thread-safe.
If the context is attached to a component in order to do component rendering,
then the MessageManager may be locked when this callback is made.
For information about how to trigger a render callback, see
OpenGLContext::triggerRepaint() and OpenGLContext::setContinuousRepainting().
*/


Loading…
Cancel
Save