Пример #1
0
void *worker_thread () {
	ruby_init();
	pthread_mutex_lock(&worker_mutex);
	pthread_mutex_unlock(&caller_mutex);

	while (1) {
		pthread_cond_wait(&call_cond, &worker_mutex);
		perform_task();
		pthread_cond_signal(&ret_cond);
	}
}
Пример #2
0
/*
 * entry point for worker threads.
 */
void * crypt_worker(void * voided_param)
{
    crypter_t * crypter = (crypter_t *)voided_param;

    while (has_more_input || crypter -> current_task != NULL)
    {
        if (crypter -> current_task == NULL) sched_yield();
        else
        {
            perform_task(crypter -> current_task);
            if (pthread_mutex_lock(&(crypter -> mutex))) perror("crypter lock failed in crypt_worker");
            crypttask_t * old_task = crypter -> current_task;
            crypter -> current_task = crypter -> current_task -> next_task;
            crypter -> num_tasks--;
            pthread_mutex_unlock(&(crypter -> mutex));
            old_task -> complete = 1;
        }
    }

    return NULL;
}
Пример #3
0
int platform_impl_guicore_step(PlatformRoopkothaGUICore*UNUSED_VAR(nothing)) {
	perform_task();
	return 0;
}