Browse Source

threads are typed

David Rose 23 years ago
parent
commit
80f29041f5
3 changed files with 19 additions and 2 deletions
  1. 2 0
      panda/src/express/config_express.cxx
  2. 1 0
      panda/src/express/thread.cxx
  3. 16 2
      panda/src/express/thread.h

+ 2 - 0
panda/src/express/config_express.cxx

@@ -20,6 +20,7 @@
 #include "config_express.h"
 #include "datagram.h"
 #include "referenceCount.h"
+#include "thread.h"
 #include "typedObject.h"
 #include "typedReferenceCount.h"
 #include "virtualFile.h"
@@ -40,6 +41,7 @@ extern void init_system_type_handles();
 ConfigureFn(config_express) {
   Datagram::init_type();
   ReferenceCount::init_type();
+  Thread::init_type();
   TypedObject::init_type();
   TypedReferenceCount::init_type();
   VirtualFile::init_type();

+ 1 - 0
panda/src/express/thread.cxx

@@ -18,6 +18,7 @@
 
 #include "thread.h"
 
+TypeHandle Thread::_type_handle;
 
 ////////////////////////////////////////////////////////////////////
 //     Function: Thread::Destructor

+ 16 - 2
panda/src/express/thread.h

@@ -20,7 +20,7 @@
 #define THREAD_H
 
 #include "pandabase.h"
-#include "referenceCount.h"
+#include "typedReferenceCount.h"
 #include "threadPriority.h"
 #include "threadImpl.h"
 #include "notify.h"
@@ -37,7 +37,7 @@
 //               will automatically be destructed if no other pointers
 //               are referencing it.
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDAEXPRESS Thread : public ReferenceCount {
+class EXPCL_PANDAEXPRESS Thread : public TypedReferenceCount {
 public:
   INLINE Thread(const string &name);
   virtual ~Thread();
@@ -66,6 +66,20 @@ private:
   string _name;
   ThreadImpl _impl;
   friend ThreadImpl;
+
+
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    TypedReferenceCount::init_type();
+    register_type(_type_handle, "Thread",
+                  TypedReferenceCount::get_class_type());
+  }
+
+private:
+  static TypeHandle _type_handle;
 };
 
 #include "thread.I"