- conn = new_connection(socket.accept());
- // TODO: poner lock.
- connections.push_back(conn);
- // TODO: sacar lock.
- // TODO: esto va en Server::new_connection()
+ connection = new_connection(socket.accept());
+#ifdef DEBUG
+ std::cerr << __FILE__ << ": real_run(): connection = " << connection
+ << std::endl;
+#endif // DEBUG
+ connections_mutex.lock();
+ // FIXME pruebo el mutex.
+ sleep(5);
+ connections.push_back(connection);
+#ifdef DEBUG
+ std::cerr << __FILE__ << ": real_run(): lista de conexiones" << std::endl;
+ for (ConnectionList::const_iterator i = connections.begin();
+ i != connections.end(); i++) {
+ std::cerr << "\t " << *i << std::endl;
+ }
+#endif // DEBUG
+ connections_mutex.unlock();