Skip to content

Commit

Permalink
* don't use the deprecated glib thread api
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerhardy committed Sep 14, 2013
1 parent 25da2e7 commit bf841a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/tools/radiant/radiant/exec.cpp
Expand Up @@ -246,7 +246,7 @@ static gpointer exec_run_remainder (gpointer data)

static void exec_cmd_delete (ExecCmd *e)
{
g_mutex_free(e->state_mutex);
g_mutex_clear(&e->state_mutex);
g_ptr_array_free(e->args, TRUE);
g_free(e->working_dir);
}
Expand All @@ -256,7 +256,7 @@ ExecCmd* exec_cmd_new (Exec **exec)
ExecCmd *e = g_new0(ExecCmd, 1);
e->args = g_ptr_array_new();
e->state = RUNNING;
e->state_mutex = g_mutex_new();
g_mutex_init(&e->state_mutex);
e->exec = *exec;
e->parse_progress = FALSE;
(*exec)->cmds = g_list_append((*exec)->cmds, e);
Expand Down Expand Up @@ -327,19 +327,19 @@ void exec_cmd_update_arg (ExecCmd *e, const gchar* arg_start, const gchar* forma
ExecState exec_cmd_get_state (ExecCmd *e)
{
g_return_val_if_fail(e != NULL, FAILED);
g_mutex_lock(e->state_mutex);
g_mutex_lock(&e->state_mutex);
ExecState ret = e->state;
g_mutex_unlock(e->state_mutex);
g_mutex_unlock(&e->state_mutex);
return ret;
}

ExecState exec_cmd_set_state (ExecCmd *e, ExecState state)
{
g_mutex_lock(e->state_mutex);
g_mutex_lock(&e->state_mutex);
if (e->state != CANCELLED)
e->state = state;
ExecState ret = e->state;
g_mutex_unlock(e->state_mutex);
g_mutex_unlock(&e->state_mutex);
return ret;
}

Expand Down Expand Up @@ -384,7 +384,7 @@ void exec_run (Exec *ex)
e->lib_proc(e, NULL);
else if (piped != NULL) {
pipe(child_child_pipe);
thread = g_thread_create(exec_run_remainder, (gpointer) piped, TRUE, NULL);
thread = g_thread_new(ex->process_title, exec_run_remainder, (gpointer) piped);
exec_spawn_process(e, exec_stdin_setup_func);
close(child_child_pipe[0]);
close(child_child_pipe[1]);
Expand Down
2 changes: 1 addition & 1 deletion src/tools/radiant/radiant/exec.h
Expand Up @@ -38,7 +38,7 @@ typedef struct
GPid pid;
gint exit_code;
ExecState state;
GMutex *state_mutex;
GMutex state_mutex;
ExecFunc lib_proc;
ExecFunc pre_proc;
ExecFunc read_proc; /**< read the output of the process from stdout */
Expand Down

0 comments on commit bf841a7

Please sign in to comment.