Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10576 in orxonox.OLD for branches/cleanup/src/lib


Ignore:
Timestamp:
Feb 7, 2007, 9:28:52 PM (18 years ago)
Author:
bensch
Message:

threads better compiled now

Location:
branches/cleanup/src/lib
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/src/lib/sound/sound_engine.h

    r10575 r10576  
    1515#include <list>
    1616#include <stack>
    17 #include "threads/threading.h"
     17#include "threads/mutex.h"
    1818
    1919#define SOUND_DOPPLER_FACTOR       0.001          //!< A factor for the audible doppler effect
  • branches/cleanup/src/lib/util/threads/mutex.h

    r10574 r10576  
    11#ifndef __MUTEX_H__
    22#define __MUTEX_H__
    3    
    4     class Mutex
     3
     4
     5#include "threadincl.h"
     6namespace OrxThread
    57{
     8
     9  class Mutex
     10  {
    611  public:
    712    Mutex() {  this->mutex = SDL_CreateMutex(); };
     
    1419  private:
    1520    SDL_mutex* mutex;
    16 };
    17 
     21  };
     22}
    1823#endif /* __MUTEX_H__ */
  • branches/cleanup/src/lib/util/threads/mutex_locker.h

    r10574 r10576  
    11#ifndef __MUTEX_LOCKER_H__
    22#define __MUTEX_LOCKER_H__
    3     //! A Class that locks a Mutex within its scope
    4     class MutexLock
     3
     4#include "mutex.h"
     5
     6namespace OrxThread
    57{
     8
     9  //! A Class that locks a Mutex within its scope
     10  class MutexLock
     11  {
    612  public:
    713    //! Locks the Mutex mutex in this Scope.
     
    1016  private:
    1117    Mutex* mutex;         //!< The Mutex to lock.
    12 };
     18  };
    1319}
    1420
  • branches/cleanup/src/lib/util/threads/thread.cc

    r10575 r10576  
    11/*
    22    orxonox - the future of 3D-vertical-scrollers
    3 
     3 
    44    Copyright (C) 2004 orx
    5 
     5 
    66    This program is free software; you can redistribute it and/or modify
    77    it under the terms of the GNU General Public License as published by
    88    the Free Software Foundation; either version 2, or (at your option)
    99    any later version.
    10 
     10 
    1111### File Specific:
    1212    main-programmer: ...
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "threading.h"
     18#include "thread.h"
    1919
    2020
    2121
    22     namespace OrxThread
     22namespace OrxThread
    2323{
    2424
    25 /**
    26    * standard constructor
    27    * @todo this constructor is not jet implemented - do it
    28  */
    29 // Thread::Thread()
    30 // {
    31 // }
     25  /**
     26     * standard constructor
     27     * @todo this constructor is not jet implemented - do it
     28   */
     29  // Thread::Thread()
     30  // {
     31  // }
    3232
    3333
    34 /**
    35    * standard deconstructor
    36  */
    37 // Thread::~Thread()
    38 // {
    39 //   // delete what has to be deleted here
    40 // }
     34  /**
     35     * standard deconstructor
     36   */
     37  // Thread::~Thread()
     38  // {
     39  //   // delete what has to be deleted here
     40  // }
    4141
    4242}
  • branches/cleanup/src/lib/util/threads/thread.h

    r10575 r10576  
    22#define __THREAD_H__
    33
    4 #ifdef HAVE_SDL_H
    5 #include <SDL_thread.h>
    6 #else
    7 #include <SDL/SDL_thread.h>
    8 #endif
     4#include "threadincl.h"
    95
    106namespace OrxThread
     
    139  class Thread
    1410  {
    15     public:
    16       Thread(int (*fn)(void *), void *data) { this->thread = SDL_CreateThread(fn, data); };
    17       virtual ~Thread() { SDL_KillThread(this->thread); }
    18       void exit ( int returnCode = 0 );
    19       bool isFinished () const;
    20       bool isRunning () const;
    21       void wait() { SDL_WaitThread(this->thread, NULL); };
     11  public:
     12    Thread(int (*fn)(void *), void *data) { this->thread = SDL_CreateThread(fn, data); };
     13    virtual ~Thread() { SDL_KillThread(this->thread); }
     14    void exit ( int returnCode = 0 );
     15    bool isFinished () const;
     16    bool isRunning () const;
     17    void wait() { SDL_WaitThread(this->thread, NULL); };
    2218
    23       void start();
    24       void terminate();
     19    void start();
     20    void terminate();
    2521
    2622
    27     private:
    28       SDL_Thread* thread;
     23  private:
     24    SDL_Thread* thread;
    2925
    3026  };
     27}
    3128
    3229#endif /* __THREAD_H__ */
Note: See TracChangeset for help on using the changeset viewer.