[LLVMdev] thread class patch to llvm/system

Duncan Sands baldrick at free.fr
Sun Aug 10 23:49:10 PDT 2008


Hi Csaba,

+      /// Releases and removes the lock
+      /// @brief Destructor
+      ~Thread ( void );

What lock is that?  Also, why ( void ) and not ()?  (Lots more
of these later).

+      typedef void (*ThreadFunc)( void *data );
+
+      /// Starts the thread with the given main function and parameter.
+      /// @brief Starts the thread.
+      void start( ThreadFunc f, void *data );

Wouldn't it be more C++ like to have start be an abstract method of
Thread.  Rather than passing a function pointer with data like now,
you would derive a subclass of Thread with the data as a field and
with start defined to do whatever the operation is.  Or something
like that.

I didn't have time to read the other files, sorry.

Ciao,

Duncan.



More information about the llvm-dev mailing list