nxt_buf.c (430:3a24c399394f) nxt_buf.c (564:762f8c976ead)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

--- 188 unchanged lines hidden (view full) ---

197 nxt_mp_t *mp;
198 nxt_buf_t *b, *parent;
199
200 b = obj;
201 parent = data;
202
203 nxt_debug(task, "buf completion: %p %p", b, b->mem.start);
204
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

--- 188 unchanged lines hidden (view full) ---

197 nxt_mp_t *mp;
198 nxt_buf_t *b, *parent;
199
200 b = obj;
201 parent = data;
202
203 nxt_debug(task, "buf completion: %p %p", b, b->mem.start);
204
205#if (NXT_DEBUG)
206 if (nxt_slow_path(data != b->parent)) {
207 nxt_log_alert(task->log, "completion data (%p) != b->parent (%p)",
208 data, b->parent);
209 nxt_abort();
210 }
211#endif
205 nxt_assert(data == b->parent);
212
213 mp = b->data;
214 nxt_mp_free(mp, b);
215
216 if (parent != NULL) {
217 nxt_debug(task, "parent retain:%uD", parent->retain);
218
219 parent->retain--;

--- 10 unchanged lines hidden (view full) ---

230nxt_int_t
231nxt_buf_ts_handle(nxt_task_t *task, void *obj, void *data)
232{
233 nxt_buf_t *b;
234 nxt_buf_ts_t *ts;
235
236 b = obj;
237
206
207 mp = b->data;
208 nxt_mp_free(mp, b);
209
210 if (parent != NULL) {
211 nxt_debug(task, "parent retain:%uD", parent->retain);
212
213 parent->retain--;

--- 10 unchanged lines hidden (view full) ---

224nxt_int_t
225nxt_buf_ts_handle(nxt_task_t *task, void *obj, void *data)
226{
227 nxt_buf_t *b;
228 nxt_buf_ts_t *ts;
229
230 b = obj;
231
238#if (NXT_DEBUG)
239 if (nxt_slow_path(b->is_ts == 0)) {
240 nxt_log_alert(task->log, "not a thread safe buf (%p) completed", b);
241 nxt_abort();
242 }
243#endif
232 nxt_assert(b->is_ts != 0);
244
245 ts = nxt_pointer_to(b, NXT_BUF_MEM_SIZE);
246
247 if (ts->engine != task->thread->engine) {
248
249 nxt_debug(task, "buf ts: %p current engine is %p, expected %p",
250 b, task->thread->engine, ts->engine);
251

--- 20 unchanged lines hidden (view full) ---

272 parent = data;
273
274 if (nxt_buf_ts_handle(task, obj, data)) {
275 return;
276 }
277
278 nxt_debug(task, "buf ts completion: %p %p", b, b->mem.start);
279
233
234 ts = nxt_pointer_to(b, NXT_BUF_MEM_SIZE);
235
236 if (ts->engine != task->thread->engine) {
237
238 nxt_debug(task, "buf ts: %p current engine is %p, expected %p",
239 b, task->thread->engine, ts->engine);
240

--- 20 unchanged lines hidden (view full) ---

261 parent = data;
262
263 if (nxt_buf_ts_handle(task, obj, data)) {
264 return;
265 }
266
267 nxt_debug(task, "buf ts completion: %p %p", b, b->mem.start);
268
280#if (NXT_DEBUG)
281 if (nxt_slow_path(data != b->parent)) {
282 nxt_log_alert(task->log, "completion data (%p) != b->parent (%p)",
283 data, b->parent);
284 nxt_abort();
285 }
286#endif
269 nxt_assert(data == b->parent);
287
288 mp = b->data;
289 nxt_mp_free(mp, b);
290 nxt_mp_release(mp);
291
292 if (parent != NULL) {
293 nxt_debug(task, "parent retain:%uD", parent->retain);
294

--- 39 unchanged lines hidden ---
270
271 mp = b->data;
272 nxt_mp_free(mp, b);
273 nxt_mp_release(mp);
274
275 if (parent != NULL) {
276 nxt_debug(task, "parent retain:%uD", parent->retain);
277

--- 39 unchanged lines hidden ---