7
7
***************************************************************************/
10
* This program is free software; you can redistribute it and/or modify
10
* Brasero is free software; you can redistribute it and/or modify
11
11
* it under the terms of the GNU General Public License as published by
12
12
* the Free Software Foundation; either version 2 of the License, or
13
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
15
* Brasero is distributed in the hope that it will be useful,
16
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
18
* GNU Library General Public License for more details.
20
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
* along with this program; if not, write to:
22
* The Free Software Foundation, Inc.,
23
* 51 Franklin Street, Fifth Floor
24
* Boston, MA 02110-1301, USA.
25
27
#ifdef HAVE_CONFIG_H
263
265
self->priv->active_tasks = g_slist_remove (self->priv->active_tasks, ctx);
264
266
g_cond_signal (self->priv->task_finished);
266
if (g_cancellable_is_cancelled (cancel)) {
267
if (ctx->type->destroy)
268
ctx->type->destroy (self, ctx->data);
272
else if (res == BRASERO_ASYNC_TASK_RESCHEDULE) {
273
if (self->priv->waiting_tasks) {
274
BraseroAsyncTaskCtx *next;
276
next = self->priv->waiting_tasks->data;
277
if (next->priority > ctx->priority)
278
brasero_async_task_manager_insert_task (self, ctx);
268
/* NOTE: when threads are cancelled then they are destroyed in
269
* the function that cancelled them to destroy callback_data in
270
* the active main loop */
271
if (!g_cancellable_is_cancelled (cancel)) {
272
if (res == BRASERO_ASYNC_TASK_RESCHEDULE) {
273
if (self->priv->waiting_tasks) {
274
BraseroAsyncTaskCtx *next;
276
next = self->priv->waiting_tasks->data;
277
if (next->priority > ctx->priority)
278
brasero_async_task_manager_insert_task (self, ctx);
280
self->priv->waiting_tasks = g_slist_prepend (self->priv->waiting_tasks, ctx);
280
283
self->priv->waiting_tasks = g_slist_prepend (self->priv->waiting_tasks, ctx);
283
self->priv->waiting_tasks = g_slist_prepend (self->priv->waiting_tasks, ctx);
286
if (ctx->type->destroy)
287
ctx->type->destroy (self, ctx->data);
291
g_cancellable_reset (cancel);
286
if (ctx->type->destroy)
287
ctx->type->destroy (self, FALSE, ctx->data);
292
g_cancellable_reset (cancel);
422
423
tasks = g_slist_remove (tasks, ctx);
424
/* NOTE: no need to call destroy callback here
425
* since it was done in the thread loop. */
426
if (ctx->type->destroy)
427
ctx->type->destroy (self, TRUE, ctx->data);
454
458
/* call the destroy callback */
455
459
if (ctx->type->destroy)
456
ctx->type->destroy (self, ctx->data);
460
ctx->type->destroy (self, TRUE, ctx->data);