}
if (handle->property->thread_mutex) {
- g_mutex_free(handle->property->thread_mutex);
+ g_mutex_clear(handle->property->thread_mutex);
+ g_free(handle->property->thread_mutex);
handle->property->thread_mutex = NULL;
debug_log("Success - free (thread_mutex)");
}
if (handle->property->thread_cond) {
- g_cond_free(handle->property->thread_cond);
+ g_cond_clear(handle->property->thread_cond);
+ g_free(handle->property->thread_cond);
handle->property->thread_cond = NULL;
debug_log("Success - free (thread_cond)");
}
if (handle->property->thread_exit_mutex) {
- g_mutex_free(handle->property->thread_exit_mutex);
+ g_mutex_clear(handle->property->thread_exit_mutex);
+ g_free(handle->property->thread_exit_mutex);
handle->property->thread_exit_mutex = NULL;
debug_log("Success - free (thread_exit_mutex)");
}
}
if (!handle->property->thread_mutex) {
- handle->property->thread_mutex = g_mutex_new();
+ handle->property->thread_mutex = g_new(GMutex, 1);
+ g_mutex_init(handle->property->thread_mutex);
debug_log("create thread_mutex: 0x%2x", handle->property->thread_mutex);
} else {
debug_error("ERROR - thread_mutex is already created");
}
if (!handle->property->thread_exit_mutex) {
- handle->property->thread_exit_mutex = g_mutex_new();
+ handle->property->thread_exit_mutex = g_new(GMutex, 1);
+ g_mutex_init(handle->property->thread_exit_mutex);
debug_log("create exit mutex: 0x%2x", handle->property->thread_exit_mutex);
} else {
debug_error("ERROR - thread_exit_mutex is already created");
}
if (!handle->property->thread_cond) {
- handle->property->thread_cond = g_cond_new();
+ handle->property->thread_cond = g_new(GCond, 1);
+ g_cond_init(handle->property->thread_cond);
debug_log("create thread cond: 0x%2x", handle->property->thread_cond);
} else {
debug_error("thread cond is already created");
/* create threads */
debug_log("create thread");
- handle->property->thread = g_thread_create((GThreadFunc)_mm_transcode_thread_repeate, (gpointer)handle, TRUE, NULL);
+ handle->property->thread = g_thread_new(NULL, (GThreadFunc)_mm_transcode_thread_repeate, (gpointer)handle);
if (!handle->property->thread) {
debug_error("ERROR - create thread");
return MM_ERROR_TRANSCODE_INTERNAL;