Skip to content
Snippets Groups Projects
Commit f36bddec authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

time only the queue lock.

Former-commit-id: 62e5b572c185f871689ee5cc94c42ad4f70ab6e0
parent f0522d5d
No related branches found
No related tags found
No related merge requests found
......@@ -146,20 +146,19 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) {
lock_type *qlock = &q->lock;
struct task *qtasks, *res = NULL;
struct cell *ci, *cj;
TIMER_TIC
/* If there are no tasks, leave immediately. */
if ( q->count == 0 ) {
TIMER_TOC(timer_queue);
if ( q->count == 0 )
return NULL;
}
/* Main loop, while there are tasks... */
while ( q->count > 0 ) {
/* Grab the task lock. */
TIMER_TIC
if ( lock_lock( qlock ) != 0 )
error( "Locking the qlock failed.\n" );
TIMER_TOC( timer_qlock );
/* Set some pointers we will use often. */
qtid = q->tid;
......@@ -264,7 +263,6 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) {
} /* while there are tasks. */
/* Take the money and run. */
TIMER_TOC(timer_queue);
return res;
}
......
......@@ -35,7 +35,7 @@ enum {
timer_dopair_subset,
timer_doghost,
timer_gettask,
timer_queue,
timer_qlock,
timer_stalled,
timer_runners,
timer_step,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment