patch-src_mutex_h 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. $OpenBSD: patch-src_mutex_h,v 1.1 2017/04/30 08:56:45 espie Exp $
  2. --- src/mutex.h.orig
  3. +++ src/mutex.h
  4. @@ -26,11 +26,15 @@
  5. /// A classical mutex.
  6. ///@note This implementation is per default recursive, so you can lock the mutex again
  7. /// in the same thread where you already have locked it.
  8. +struct SDL_mutex;
  9. +class condvar;
  10. +
  11. +namespace dd {
  12. class mutex
  13. {
  14. - friend class condvar;
  15. + friend class ::condvar;
  16. protected:
  17. - struct SDL_mutex* mtx;
  18. + struct ::SDL_mutex* mtx;
  19. private:
  20. mutex(const mutex& );
  21. mutex& operator=(const mutex& );
  22. @@ -47,9 +51,9 @@ class mutex
  23. /// unlock the mutex
  24. void unlock();
  25. };
  26. +}
  27. -
  28. /// A handy helper class for mutexes.
  29. ///@note Create a local object of that class and give it a mutex. It will lock the mutex
  30. /// in its constructor and automatically unlock it in the destructor.
  31. @@ -57,6 +61,7 @@ class mutex
  32. /// inside the block or function that the object is declared in.
  33. class mutex_locker
  34. {
  35. + typedef dd::mutex mutex;
  36. protected:
  37. mutex& mymutex;
  38. private: