From 613867a2ce846855cc67d78b404a44a88b776a56 Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <pedro.gonnet@durham.ac.uk>
Date: Fri, 5 Jul 2013 13:32:55 +0000
Subject: [PATCH] queue_gettask no longer needs to know what the qid is.

Former-commit-id: e3b091df016a5439da38e5e8ec3eee8587531e43
---
 src/queue.c     | 2 +-
 src/queue.h     | 2 +-
 src/scheduler.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/queue.c b/src/queue.c
index dc601abfd1..d52a9ac2c4 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -130,7 +130,7 @@ void queue_init ( struct queue *q , struct task *tasks ) {
  * @param keep Remove the returned task from this queue.
  */
  
-struct task *queue_gettask ( struct queue *q , int qid , struct cell *super , int blocking ) {
+struct task *queue_gettask ( struct queue *q , struct cell *super , int blocking ) {
 
     int k, temp, qcount, *qtid, gotcha;
     lock_type *qlock = &q->lock;
diff --git a/src/queue.h b/src/queue.h
index 66444db8a9..76ae9b6971 100644
--- a/src/queue.h
+++ b/src/queue.h
@@ -51,6 +51,6 @@ struct queue {
     
 
 /* Function prototypes. */
-struct task *queue_gettask ( struct queue *q , int qid , struct cell *super , int blocking );
+struct task *queue_gettask ( struct queue *q , struct cell *super , int blocking );
 void queue_init ( struct queue *q , struct task *tasks );
 void queue_insert ( struct queue *q , struct task *t );
diff --git a/src/scheduler.c b/src/scheduler.c
index 3b08ad9d5a..056d0183ac 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -850,7 +850,7 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid , struct cell *su
         for ( int tries = 0 ; res == NULL && s->waiting && tries < scheduler_maxtries ; tries++ ) {
         
             /* Try to get a task from the suggested queue. */
-            if ( s->queues[qid].count > 0 && ( res = queue_gettask( &s->queues[qid] , qid , super , 1 ) ) != NULL )
+            if ( s->queues[qid].count > 0 && ( res = queue_gettask( &s->queues[qid] , super , 1 ) ) != NULL )
                 break;
 
             /* If unsucessful, try stealing from the other queues. */
@@ -861,7 +861,7 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid , struct cell *su
                         qids[ count++ ] = k;
                 for ( k = 0 ; k < scheduler_maxsteal && count > 0 ; k++ ) {
                     int ind = rand() % count;
-                    if ( ( res = queue_gettask( &s->queues[ qids[ ind ] ] , qid , super , 0 ) ) != NULL )
+                    if ( ( res = queue_gettask( &s->queues[ qids[ ind ] ] , super , 0 ) ) != NULL )
                         break;
                     else 
                         qids[ ind ] = qids[ --count ];
-- 
GitLab