~ubuntu-branches/ubuntu/precise/cpufreqd/precise

« back to all changes in this revision

Viewing changes to src/cpufreqd_exec.c

  • Committer: Bazaar Package Importer
  • Author(s): Mattia Dongili
  • Date: 2010-04-18 23:08:30 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100418230830-2whwcjxddq9mxcxo
Tags: 2.4.2-1
New upstream release: fixes configuration with libsensors4
(Closes: #577822).

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        pid_t child_pid = 0;
65
65
        int child_ret = 0;
66
66
        struct sigaction signal_action;
67
 
        
 
67
 
68
68
        while (1) {
69
69
                pthread_mutex_lock(&exe_q_mtx);
70
70
                while (exe_q == NULL) {
120
120
                                                clog(LOG_WARNING, "\"%s\" exited with status %d\n",
121
121
                                                                etemp->cmd, child_ret);
122
122
                                        }
123
 
                                                
 
123
 
124
124
                        }
125
125
                        free(etemp);
126
126
                } else
134
134
static void exec_enqueue (const char *cmd) {
135
135
        struct exec_cmd *etemp = NULL;
136
136
        struct exec_cmd *loop = NULL;
137
 
        
 
137
 
138
138
        pthread_mutex_lock(&exe_q_mtx);
139
139
 
140
140
        etemp = calloc(1, sizeof(struct exec_cmd));
212
212
static int exec_exit (void) {
213
213
        int ret = 0;
214
214
        struct exec_cmd *etemp = NULL;
215
 
        
 
215
 
216
216
        pthread_mutex_lock(&exe_q_mtx);
217
217
        /* push exit into queue */
218
218
        exe_exit_cmd.next = exe_q;
219
219
        exe_q = &exe_exit_cmd;
220
 
        
 
220
 
221
221
        /* wake the thread */
222
222
        pthread_cond_signal(&exe_q_cond);
223
223
        pthread_mutex_unlock(&exe_q_mtx);
227
227
        if (ret != 0) {
228
228
                clog(LOG_ERR, "Couldn't join exec thread.\n");
229
229
        }
230
 
        
 
230
 
231
231
        /* free command list if any no need to acquire the mutex */
232
232
        while (exe_q != NULL) {
233
233
                etemp = exe_q;