mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
benchmark/gem_latency: sync startup correctly
When waiting for the producers to start, use the cond/mutex of the Nth producer and not always the first. Spotted-by: "Goel, Akash" <akash.goel@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
4a62f0b43f
commit
79f804e8d8
@ -471,10 +471,10 @@ static int run(int seconds,
|
|||||||
pthread_create(&p[n].consumers[m].thread, NULL,
|
pthread_create(&p[n].consumers[m].thread, NULL,
|
||||||
consumer, &p[n].consumers[m]);
|
consumer, &p[n].consumers[m]);
|
||||||
}
|
}
|
||||||
pthread_mutex_lock(&p->lock);
|
pthread_mutex_lock(&p[n].lock);
|
||||||
while (p->wait)
|
while (p[n].wait)
|
||||||
pthread_cond_wait(&p->p_cond, &p->lock);
|
pthread_cond_wait(&p[n].p_cond, &p[n].lock);
|
||||||
pthread_mutex_unlock(&p->lock);
|
pthread_mutex_unlock(&p[n].lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user