Improve thread safety.

This commit is contained in:
lotodore
2011-01-12 23:35:45 +00:00
parent b6c820718a
commit 2a7456998a
10 changed files with 51 additions and 39 deletions
+4 -7
View File
@@ -35,7 +35,6 @@ public:
~ClientBoard();
void setPlayerLists(PlayerList, PlayerList, PlayerList);
void setHand(HandInterface*);
void setMyCards(int* theValue);
void getMyCards(int* theValue);
@@ -52,13 +51,13 @@ public:
void collectPot();
void distributePot();
void determinePlayerNeedToShowCards();
void determinePlayerNeedToShowCards();
std::list<unsigned> getWinners() const;
void setWinners(const std::list<unsigned> &winners);
std::list<unsigned> getPlayerNeedToShowCards() const;
void setPlayerNeedToShowCards(const std::list<unsigned> &playerNeedToShowCards);
std::list<unsigned> getPlayerNeedToShowCards() const;
void setPlayerNeedToShowCards(const std::list<unsigned> &playerNeedToShowCards);
private:
mutable boost::recursive_mutex m_syncMutex;
@@ -67,10 +66,8 @@ private:
PlayerList activePlayerList;
PlayerList runningPlayerList;
HandInterface *currentHand;
std::list<unsigned> winners;
std::list<unsigned> playerNeedToShowCards;
std::list<unsigned> playerNeedToShowCards;
int myCards[5];
int pot;