• Home
  • Raw
  • Download

Lines Matching refs:o

35     pa_operation *o;  in pa_operation_new()  local
38 if (!(o = pa_flist_pop(PA_STATIC_FLIST_GET(operations)))) in pa_operation_new()
39 o = pa_xnew(pa_operation, 1); in pa_operation_new()
41 pa_zero(*o); in pa_operation_new()
43 PA_REFCNT_INIT(o); in pa_operation_new()
44 o->context = c; in pa_operation_new()
45 o->stream = s; in pa_operation_new()
47 o->state = PA_OPERATION_RUNNING; in pa_operation_new()
48 o->callback = cb; in pa_operation_new()
49 o->userdata = userdata; in pa_operation_new()
52 PA_LLIST_PREPEND(pa_operation, c->operations, o); in pa_operation_new()
53 pa_operation_ref(o); in pa_operation_new()
55 return o; in pa_operation_new()
58 pa_operation *pa_operation_ref(pa_operation *o) { in pa_operation_ref() argument
59 pa_assert(o); in pa_operation_ref()
60 pa_assert(PA_REFCNT_VALUE(o) >= 1); in pa_operation_ref()
62 PA_REFCNT_INC(o); in pa_operation_ref()
63 return o; in pa_operation_ref()
66 void pa_operation_unref(pa_operation *o) { in pa_operation_unref() argument
67 pa_assert(o); in pa_operation_unref()
68 pa_assert(PA_REFCNT_VALUE(o) >= 1); in pa_operation_unref()
70 if (PA_REFCNT_DEC(o) <= 0) { in pa_operation_unref()
71 pa_assert(!o->context); in pa_operation_unref()
72 pa_assert(!o->stream); in pa_operation_unref()
74 if (pa_flist_push(PA_STATIC_FLIST_GET(operations), o) < 0) in pa_operation_unref()
75 pa_xfree(o); in pa_operation_unref()
79 static void operation_unlink(pa_operation *o) { in operation_unlink() argument
80 pa_assert(o); in operation_unlink()
82 if (o->context) { in operation_unlink()
83 pa_assert(PA_REFCNT_VALUE(o) >= 2); in operation_unlink()
85 PA_LLIST_REMOVE(pa_operation, o->context->operations, o); in operation_unlink()
86 pa_operation_unref(o); in operation_unlink()
88 o->context = NULL; in operation_unlink()
91 o->stream = NULL; in operation_unlink()
92 o->callback = NULL; in operation_unlink()
93 o->userdata = NULL; in operation_unlink()
94 o->state_callback = NULL; in operation_unlink()
95 o->state_userdata = NULL; in operation_unlink()
98 static void operation_set_state(pa_operation *o, pa_operation_state_t st) { in operation_set_state() argument
99 pa_assert(o); in operation_set_state()
100 pa_assert(PA_REFCNT_VALUE(o) >= 1); in operation_set_state()
102 if (st == o->state) in operation_set_state()
105 if ((o->state == PA_OPERATION_DONE) || (o->state == PA_OPERATION_CANCELED)) in operation_set_state()
108 pa_operation_ref(o); in operation_set_state()
110 o->state = st; in operation_set_state()
112 if (o->state_callback) in operation_set_state()
113 o->state_callback(o, o->state_userdata); in operation_set_state()
115 if ((o->state == PA_OPERATION_DONE) || (o->state == PA_OPERATION_CANCELED)) in operation_set_state()
116 operation_unlink(o); in operation_set_state()
118 pa_operation_unref(o); in operation_set_state()
121 void pa_operation_cancel(pa_operation *o) { in pa_operation_cancel() argument
122 pa_assert(o); in pa_operation_cancel()
123 pa_assert(PA_REFCNT_VALUE(o) >= 1); in pa_operation_cancel()
125 operation_set_state(o, PA_OPERATION_CANCELED); in pa_operation_cancel()
128 void pa_operation_done(pa_operation *o) { in pa_operation_done() argument
129 pa_assert(o); in pa_operation_done()
130 pa_assert(PA_REFCNT_VALUE(o) >= 1); in pa_operation_done()
132 operation_set_state(o, PA_OPERATION_DONE); in pa_operation_done()
135 pa_operation_state_t pa_operation_get_state(const pa_operation *o) { in pa_operation_get_state() argument
136 pa_assert(o); in pa_operation_get_state()
137 pa_assert(PA_REFCNT_VALUE(o) >= 1); in pa_operation_get_state()
139 return o->state; in pa_operation_get_state()
142 void pa_operation_set_state_callback(pa_operation *o, pa_operation_notify_cb_t cb, void *userdata) { in pa_operation_set_state_callback() argument
143 pa_assert(o); in pa_operation_set_state_callback()
144 pa_assert(PA_REFCNT_VALUE(o) >= 1); in pa_operation_set_state_callback()
149 if (o->state == PA_OPERATION_DONE || o->state == PA_OPERATION_CANCELED) in pa_operation_set_state_callback()
152 o->state_callback = cb; in pa_operation_set_state_callback()
153 o->state_userdata = userdata; in pa_operation_set_state_callback()