From 37ba81a540460a7d34a33c23d2353ac84f887576 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 17 Aug 2013 20:06:59 +0000 Subject: Make more plug-ins use and implement RunOnMainThreadSync. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86706 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/DFXVideo/macsrc/PluginGLView.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'macosx/plugins/DFXVideo/macsrc/PluginGLView.h') diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.h b/macosx/plugins/DFXVideo/macsrc/PluginGLView.h index fe2e5f78..77fe06c9 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.h +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.h @@ -24,6 +24,15 @@ #define IMAGE_COUNT 2 +static inline void RunOnMainThreadSync(dispatch_block_t block) +{ + if ([NSThread isMainThread]) { + block(); + } else { + dispatch_sync(dispatch_get_main_queue(), block); + } +} + @interface PluginGLView : NSOpenGLView { GLubyte *image_base; -- cgit v1.2.3