[haiku-commits] r33940 - haiku/trunk/src/system/kernel

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 7 Nov 2009 17:33:29 +0100 (CET)

Author: mmlr
Date: 2009-11-07 17:33:29 +0100 (Sat, 07 Nov 2009)
New Revision: 33940
Changeset: http://dev.haiku-os.org/changeset/33940/haiku

Modified:
   haiku/trunk/src/system/kernel/thread.cpp
Log:
That was not such a good destruction order in the error case. As the scheduler
accesses the scheduler data inside the thread structure, freeing it first lead
to a crash when a thread couldn't be created.


Modified: haiku/trunk/src/system/kernel/thread.cpp
===================================================================
--- haiku/trunk/src/system/kernel/thread.cpp    2009-11-07 11:53:34 UTC (rev 
33939)
+++ haiku/trunk/src/system/kernel/thread.cpp    2009-11-07 16:33:29 UTC (rev 
33940)
@@ -313,9 +313,10 @@
 err1:
        // ToDo: put them in the dead queue instead?
        if (inthread == NULL) {
+               scheduler_on_thread_destroy(thread);
                free(thread);
-               scheduler_on_thread_destroy(thread);
        }
+
        return NULL;
 }
 


Other related posts:

  • » [haiku-commits] r33940 - haiku/trunk/src/system/kernel - mmlr