[vmkit-commits] [vmkit] r142679 - /vmkit/trunk/include/mvm/Threads/Thread.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Fri Oct 21 13:24:47 PDT 2011


Author: geoffray
Date: Fri Oct 21 15:24:47 2011
New Revision: 142679

URL: http://llvm.org/viewvc/llvm-project?rev=142679&view=rev
Log:
Rearrange ExceptionBuffer a bit.


Modified:
    vmkit/trunk/include/mvm/Threads/Thread.h

Modified: vmkit/trunk/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=142679&r1=142678&r2=142679&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/Threads/Thread.h (original)
+++ vmkit/trunk/include/mvm/Threads/Thread.h Fri Oct 21 15:24:47 2011
@@ -284,18 +284,27 @@
 class ExceptionBuffer {
 public:
   ExceptionBuffer() {
+    init();
+  }
+
+  void init() {
     Thread* th = Thread::get();
     previousBuffer = th->lastExceptionBuffer;
     th->lastExceptionBuffer = this;
   }
 
   ~ExceptionBuffer() {
+    remove();
+  }
+
+  void remove() {
     Thread* th = Thread::get();
     assert(th->lastExceptionBuffer == this && "Wrong exception buffer");
     th->lastExceptionBuffer = previousBuffer;
   }
-  ExceptionBuffer* previousBuffer;
+
   jmp_buf buffer;
+  ExceptionBuffer* previousBuffer;
 };
 
 /// StackWalker - This class walks the stack of threads, returning a FrameInfo





More information about the vmkit-commits mailing list