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 int ABTI_sched_discard_and_free(ABTI_local *p_local,
47 p_sched->used = ABTI_SCHED_NOT_USED;
48 if (p_sched->automatic ==
ABT_TRUE) {
49 abt_errno = ABTI_sched_free(p_local, p_sched);
54 static inline void ABTI_sched_set_request(ABTI_sched *p_sched, uint32_t req)
56 ABTD_atomic_fetch_or_uint32(&p_sched->request, req);
59 static inline void ABTI_sched_unset_request(ABTI_sched *p_sched, uint32_t req)
61 ABTD_atomic_fetch_and_uint32(&p_sched->request, ~req);
64 static inline ABT_bool ABTI_sched_has_unit(ABTI_sched *p_sched)
69 for (p = 0; p < p_sched->num_pools; p++) {
71 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
72 s = ABTI_pool_get_size(p_pool);
80 #ifdef ABT_CONFIG_USE_SCHED_SLEEP 81 #define CNT_DECL(c) int c 82 #define CNT_INIT(c, v) c = v 83 #define CNT_INC(c) c++ 84 #define SCHED_SLEEP(c, t) \ 89 #define CNT_INIT(c, v) 91 #define SCHED_SLEEP(c, t) struct ABT_sched_opaque * ABT_sched
struct ABT_pool_opaque * ABT_pool