/[svn]/linuxsampler/trunk/src/common/Thread.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/Thread.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 56 by schoenebeck, Tue Apr 27 09:21:58 2004 UTC revision 1212 by schoenebeck, Tue May 29 23:59:36 2007 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6     *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 32  Line 33 
33  #include <pthread.h>  #include <pthread.h>
34  #include <errno.h>  #include <errno.h>
35    
36    namespace LinuxSampler {
37    
38  /// Abstract base class for classes that need to run in an own thread.  /// Abstract base class for classes that need to run in an own thread.
39  class Thread {  class Thread {
40      public:      public:
41          Thread(bool RealTime, int PriorityMax, int PriorityDelta);          Thread(bool LockMemory, bool RealTime, int PriorityMax, int PriorityDelta);
42          virtual ~Thread();          virtual ~Thread();
43          virtual int  StartThread();          virtual int  StartThread();
44          virtual int  StopThread();          virtual int  StopThread();
45            virtual int  SignalStartThread();
46          virtual int  SignalStopThread();          virtual int  SignalStopThread();
47          virtual bool IsRunning() { return Running; }          virtual bool IsRunning();
48          virtual int  SetSchedulingPriority(); //FIXME: should be private          virtual int  SetSchedulingPriority(); //FIXME: should be private
49            virtual int  LockMemory();            //FIXME: should be private
50          virtual void EnableDestructor();      //FIXME: should be private          virtual void EnableDestructor();      //FIXME: should be private
51          virtual int  Destructor();            //FIXME: should be private          virtual int  Destructor();            //FIXME: should be private
52          virtual int  Main() = 0; ///< This method needs to be implemented by the descendant and is the entry point for the new thread. FIXME: should be protected          virtual int  Main() = 0; ///< This method needs to be implemented by the descendant and is the entry point for the new thread. FIXME: should be protected
# Line 49  class Thread { Line 54  class Thread {
54          pthread_t       __thread_id;          pthread_t       __thread_id;
55          pthread_key_t   __thread_destructor_key;          pthread_key_t   __thread_destructor_key;
56          pthread_mutex_t __thread_state_mutex;          pthread_mutex_t __thread_state_mutex;
57            pthread_cond_t  __thread_start_condition;
58          pthread_cond_t  __thread_exit_condition;          pthread_cond_t  __thread_exit_condition;
59          int             PriorityMax;          int             PriorityMax;
60          int             PriorityDelta;          int             PriorityDelta;
61          bool            Running;          bool            Running;
62          bool            isRealTime;          bool            isRealTime;
63            bool            bLockedMemory;
64  };  };
65    
66  // Callback functions for the POSIX thread API  // Callback functions for the POSIX thread API
67  void* __pthread_launcher(void* thread);  void* __pthread_launcher(void* thread);
68  void  __pthread_destructor(void* thread);  void  __pthread_destructor(void* thread);
69    
70    } // namespace LinuxSampler
71    
72  #endif // __THREAD_H__  #endif // __THREAD_H__

Legend:
Removed from v.56  
changed lines
  Added in v.1212

  ViewVC Help
Powered by ViewVC