Ejemplo n.º 1
0
void writing(int *writer_id)
{
    while(1){
        think_up_data(*writer_id);
        pthread_mutex_lock(&db);
        write_data_base(*writer_id);
        pthread_mutex_unlock(&db);
    }
}
Ejemplo n.º 2
0
void writer(void) {
	int item;

	while (1 == 1) {
		item = create_data();
		down(&db);
		write_data_base(item);
		up(&db);
	}
}