NetworkTable: Protect listeners with mutex.

This commit is contained in:
Peter Johnson
2015-08-27 23:39:52 -07:00
parent 6c8a5935c9
commit 6e4d7ca933
2 changed files with 5 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
#ifndef _NETWORKTABLE_H_
#define _NETWORKTABLE_H_
#include <mutex>
#include <vector>
#include "tables/ITable.h"
@@ -10,6 +11,7 @@ class NetworkTable : public ITable {
struct private_init {};
std::string m_path;
std::mutex m_mutex;
typedef std::pair<ITableListener*, unsigned int> Listener;
std::vector<Listener> m_listeners;