Skip to content

Commit

Permalink
Merge branch 'dev/franku/master/cleanup' into dev/franku/master/pam
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Jun 1, 2018
2 parents 96fccb4 + 8f073e8 commit 9078689
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions core/src/lib/connection_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,20 @@ class DLL_IMP_EXP ConnectionPool : public SmartAlloc {
ConnectionPool();
~ConnectionPool();

void cleanup();
Connection *add_connection(const char* name, int protocol_version, BareosSocket* socket, bool authenticated = true);
Connection *remove(const char* name, int timeout_in_seconds = 0);
alist *get_as_alist();

private:
alist *connections_;
int WaitForNewConnection(timespec &timeout);
bool add(Connection *connection);
Connection *add_connection(const char* name, int protocol_version, BareosSocket* socket, bool authenticated = true);
bool remove(Connection *connection);
bool exists(const char *name);
void cleanup();
Connection *get_connection(const char *name);
Connection *get_connection(const char *name, int timeout_seconds);
Connection *get_connection(const char *name, timespec &timeout);
int WaitForNewConnection(timespec &timeout);
/*
* remove specific connection.
*/
bool remove(Connection *connection);
/*
* remove connection from pool to be used by some other component.
*/
Connection *remove(const char* name, int timeout_in_seconds = 0);

private:
alist *connections_;
pthread_mutex_t add_mutex_;
pthread_cond_t add_cond_var_;
};
Expand Down

0 comments on commit 9078689

Please sign in to comment.