6 #ifndef ABTI_SCHED_H_INCLUDED
7 #define ABTI_SCHED_H_INCLUDED
11 static inline ABTI_sched *ABTI_sched_get_ptr(
ABT_sched sched)
13 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
18 p_sched = (ABTI_sched *)sched;
22 return (ABTI_sched *)sched;
26 static inline ABT_sched ABTI_sched_get_handle(ABTI_sched *p_sched)
28 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
30 if (p_sched == NULL) {
43 static inline void ABTI_sched_discard_and_free(ABTI_global *p_global,
48 p_sched->used = ABTI_SCHED_NOT_USED;
49 if (p_sched->automatic ==
ABT_TRUE || force_free) {
50 ABTI_sched_free(p_global, p_local, p_sched, force_free);
53 if (p_sched->p_ythread) {
54 ABTI_thread_free(p_global, p_local, &p_sched->p_ythread->thread);
55 p_sched->p_ythread = NULL;
60 static inline void ABTI_sched_set_request(ABTI_sched *p_sched, uint32_t req)
62 ABTD_atomic_fetch_or_uint32(&p_sched->request, req);
65 static inline void ABTI_sched_unset_request(ABTI_sched *p_sched, uint32_t req)
67 ABTD_atomic_fetch_and_uint32(&p_sched->request, ~req);
70 #ifdef ABT_CONFIG_USE_SCHED_SLEEP
71 #define CNT_DECL(c) int c
72 #define CNT_INIT(c, v) c = v
73 #define CNT_INC(c) c++
74 #define SCHED_SLEEP(c, t) \
79 #define CNT_INIT(c, v)
81 #define SCHED_SLEEP(c, t)