Browse Source

WIP threads.

Mark Sibly 7 years ago
parent
commit
b3d70b240b
1 changed files with 7 additions and 8 deletions
  1. 7 8
      modules/monkey/native/bbdebug.h

+ 7 - 8
modules/monkey/native/bbdebug.h

@@ -79,8 +79,8 @@ struct bbDBContext{
 	bbDBFrame *frames=nullptr;
 	bbDBVar *localsBuf=nullptr;
 	bbDBVar *locals=nullptr;
-	int stepMode;
-	int stopped;
+	int stepMode=0;
+	int stopped=0;
 
 	~bbDBContext();
 	
@@ -89,20 +89,19 @@ struct bbDBContext{
 
 namespace bbDB{
 
+#ifdef BB_THREADS	
+	extern std::atomic_int nextSeq;
+	extern thread_local bbDBContext *currentContext;
+#else
 	extern int nextSeq;
-
 	extern bbDBContext *currentContext;
+#endif
 	
 	void init();
-	
 	void stop();
-	
 	void stopped();
-	
 	void error( bbString err );
-	
 	bbArray<bbString> stack();
-	
 	void emitStack();
 }