Browse Source

new function to move the contents of a list

Nathalie Furmento 6 years ago
parent
commit
49abba4b85
2 changed files with 8 additions and 3 deletions
  1. 4 1
      include/starpu_task_list.h
  2. 4 2
      src/common/list.h

+ 4 - 1
include/starpu_task_list.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2012,2014,2016-2017                 Université de Bordeaux
- * Copyright (C) 2011-2014,2017                           CNRS
+ * Copyright (C) 2011-2014,2017,2018                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -77,6 +77,9 @@ struct starpu_task *starpu_task_list_next(const struct starpu_task *task);
 STARPU_TASK_LIST_INLINE
 int starpu_task_list_ismember(const struct starpu_task_list *list, const struct starpu_task *look);
 
+STARPU_TASK_LIST_INLINE
+void starpu_task_list_move(struct starpu_task_list *ldst, struct starpu_task_list *lsrc);
+
 #ifdef __cplusplus
 }
 #endif

+ 4 - 2
src/common/list.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2008-2018                                Université de Bordeaux
- * Copyright (C) 2010-2012,2015-2017                      CNRS
+ * Copyright (C) 2010-2012,2015-2018                      CNRS
  * Copyright (C) 2017                                     Inria
  * Copyright (C) 2013                                     Thibaut Lambert
  *
@@ -264,7 +264,9 @@
     { struct ENAME *i=l->_head; while(i) \
     { if ((i->_next == NULL) && i != l->_tail) return 0; \
       if (i->_next == i) return 0; \
-      i=i->_next;} return 1; }
+      i=i->_next;} return 1; } \
+  /** @internal */LIST_INLINE void ENAME##_list_move(struct ENAME##_list *ldst, struct ENAME##_list *lsrc) \
+    { ENAME##_list_init(ldst); ldst->_head = lsrc->_head; ldst->_tail = lsrc->_tail; lsrc->_head = NULL; lsrc->_tail = NULL; }
 
 
 #ifdef STARPU_DEBUG