summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorEthan Vrhel <ethanvrhel@gmail.com>2021-11-25 01:26:08 -0800
committerEthan Vrhel <ethanvrhel@gmail.com>2021-12-03 14:49:45 -0800
commit668f84f1d260c4a1dc915624079c28fe845b5843 (patch)
treec6a5cf955b660b71ece054958847813cd135b827 /demos
parentf9166f71f2ab1461d5ac4830e02049893f5be5f4 (diff)
downloadghostpdl-668f84f1d260c4a1dc915624079c28fe845b5843.tar.gz
Multithreading for gs_jni is now enabled by default
Diffstat (limited to 'demos')
-rw-r--r--demos/java/jni/gs_jni/instance_data.cpp8
-rw-r--r--demos/java/jni/gs_jni/settings.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/demos/java/jni/gs_jni/instance_data.cpp b/demos/java/jni/gs_jni/instance_data.cpp
index 3bf315aee..a65cdf5e7 100644
--- a/demos/java/jni/gs_jni/instance_data.cpp
+++ b/demos/java/jni/gs_jni/instance_data.cpp
@@ -4,7 +4,7 @@
#include <assert.h>
#include <mutex>
-#if defined(GSJNI_SUPPORT_MT)
+#if !defined(GSJNI_NO_MT)
static std::unordered_map<void *, GSInstanceData *> g_inst2Data; // instance -> data
static std::mutex g_mtx;
@@ -17,7 +17,7 @@ static GSInstanceData g_global; // Global instance for faster multithreading
GSInstanceData *putInstanceData(GSInstanceData *data)
{
-#if defined(GSJNI_SUPPORT_MT)
+#if !defined(GSJNI_NO_MT)
g_mtx.lock();
assert(g_inst2Data.find(data->instance) == g_inst2Data.end());
@@ -36,7 +36,7 @@ GSInstanceData *putInstanceData(GSInstanceData *data)
GSInstanceData *findDataFromInstance(void *instance)
{
-#if defined(GSJNI_SUPPORT_MT)
+#if !defined(GSJNI_NO_MT)
g_mtx.lock();
auto it = g_inst2Data.find(instance);
@@ -52,7 +52,7 @@ GSInstanceData *findDataFromInstance(void *instance)
void deleteDataFromInstance(void *instance)
{
-#if defined(GSJNI_SUPPORT_MT)
+#if !defined(GSJNI_NO_MT)
g_mtx.lock();
auto i2dit = g_inst2Data.find(instance);
diff --git a/demos/java/jni/gs_jni/settings.h b/demos/java/jni/gs_jni/settings.h
index 7e3edb30d..9bd7490ac 100644
--- a/demos/java/jni/gs_jni/settings.h
+++ b/demos/java/jni/gs_jni/settings.h
@@ -1,5 +1,5 @@
#pragma once
-// Use to support multithreading, ghostpdl must be compiled with multithreading
+// Use to disable multithreading support, ghostpdl must be compiled with multithreading
// enabled as well
-#define GSJNI_SUPPORT_MT \ No newline at end of file
+//#define GSJNI_NO_MT \ No newline at end of file