[pisa-src] r1384 - trunk/libpisa/scheduler.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Wed, 28 Oct 2009 15:30:15 +0100

Author: tjansen
Date: Wed Oct 28 15:30:15 2009
New Revision: 1384

Log:
pisa_sched_remove uses the mutex and the pipe. Therefore we have to call
pisa_sched_remove before we destroy the mutex and close the pipes.

Modified:
   trunk/libpisa/scheduler.c

Modified: trunk/libpisa/scheduler.c
==============================================================================
--- trunk/libpisa/scheduler.c   Wed Oct 28 15:18:27 2009        (r1383)
+++ trunk/libpisa/scheduler.c   Wed Oct 28 15:30:15 2009        (r1384)
@@ -103,15 +103,15 @@
        pthread_cancel(sched->thread);
        pthread_join(sched->thread, NULL);
 
+       while (sched->head)
+               pisa_sched_remove(sched, sched->head);
+
        close(sched->pipe_sched[0]);
        close(sched->pipe_sched[1]);
        close(sched->pipe_main[0]);
        close(sched->pipe_main[1]);
 
        pthread_mutex_destroy(&sched->mutex_list);
-
-       while (sched->head)
-               pisa_sched_remove(sched, sched->head);
 }
 
 /**

Other related posts:

  • » [pisa-src] r1384 - trunk/libpisa/scheduler.c - Thomas Jansen