Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 6, 2007, 11:32:34 PM (16 years ago)
Author:
scheusso
Message:

added boost:mutex to PacketBuffer in order to make it thread safe; adjuster PacketBufferTest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/PacketBuffer.h

    r173 r174  
    1616#include <queue>
    1717#include <string>
     18#include <boost/bind.hpp>
     19#include <boost/thread/mutex.hpp>
     20#include <boost/thread/mutex.hpp>
     21
     22//this is needed in order to make the packetbuffer threadsafe
     23boost::mutex networkPacketBufferMutex;
    1824
    1925namespace network{
     
    3238public:
    3339  PacketBuffer();
    34   bool isLocked();
    3540  bool isEmpty();
     41  bool isClosed();
     42  void setClosed(bool value);
     43  void print();
    3644  // pops a packet from the queue
    37   PacketEnvelope *pop();
     45  PacketEnvelope pop();
    3846  // pushs a packet to the queue
    3947  bool push(PacketEnvelope pck);
    40   void print();
    4148private:
    42   bool locked;
    4349  QueueItem *first;
    4450  QueueItem *last;
     51  bool closed;
     52 
     53  //make it threadsafe
     54//   boost::mutex mutex;
    4555};
    4656
Note: See TracChangeset for help on using the changeset viewer.