ARGOBOTS
abti_task.h
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  * See COPYRIGHT in top-level directory.
4  */
5 
6 #ifndef ABTI_TASK_H_INCLUDED
7 #define ABTI_TASK_H_INCLUDED
8 
9 /* Inlined functions for Tasklet */
10 
11 static inline ABTI_task *ABTI_task_get_ptr(ABT_task task)
12 {
13 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
14  ABTI_task *p_task;
15  if (task == ABT_TASK_NULL) {
16  p_task = NULL;
17  } else {
18  p_task = (ABTI_task *)task;
19  }
20  return p_task;
21 #else
22  return (ABTI_task *)task;
23 #endif
24 }
25 
26 static inline ABT_task ABTI_task_get_handle(ABTI_task *p_task)
27 {
28 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
29  ABT_task h_task;
30  if (p_task == NULL) {
31  h_task = ABT_TASK_NULL;
32  } else {
33  h_task = (ABT_task)p_task;
34  }
35  return h_task;
36 #else
37  return (ABT_task)p_task;
38 #endif
39 }
40 
41 static inline void ABTI_task_set_request(ABTI_task *p_task, uint32_t req)
42 {
43  ABTD_atomic_fetch_or_uint32(&p_task->request, req);
44 }
45 
46 static inline void ABTI_task_unset_request(ABTI_task *p_task, uint32_t req)
47 {
48  ABTD_atomic_fetch_and_uint32(&p_task->request, ~req);
49 }
50 
51 #endif /* ABTI_TASK_H_INCLUDED */
struct ABT_task_opaque * ABT_task
Definition: abt.h:289
#define ABT_TASK_NULL
Definition: abt.h:346