configured = false;
/** to prevent concurrent Python C-API calls */
- pthread_mutex_init(&py_mutex, NULL);
+ g_mutex_init (&py_mutex);
}
/**
Py_Finalize();
dlclose(handle);
+ g_mutex_clear (&py_mutex);
}
/**
#include <glib.h>
#include <string.h>
#include <dlfcn.h>
-#include <pthread.h>
#include <structmember.h>
#include "nnstreamer_plugin_api_filter.h"
/** @brief Return callback type */
cb_type getCbType () { return callback_type; }
/** @brief Lock python-related actions */
- void Py_LOCK() { pthread_mutex_lock(&py_mutex); }
+ void Py_LOCK() { g_mutex_lock (&py_mutex); }
/** @brief Unlock python-related actions */
- void Py_UNLOCK() { pthread_mutex_unlock(&py_mutex); }
+ void Py_UNLOCK() { g_mutex_unlock (&py_mutex); }
PyObject* PyTensorShape_New (const GstTensorInfo *info);
PyObject* core_obj;
PyObject* shape_cls;
- pthread_mutex_t py_mutex;
+ GMutex py_mutex;
GstTensorsInfo inputTensorMeta; /**< The tensor info of input tensors */
GstTensorsInfo outputTensorMeta; /**< The tensor info of output tensors */