Fixed many error handling issues regading to timing and multiple threads.

Added flags to those backend references which have sent something to backend which causes the backend to send results or reply back. Didn't add removal of the flag since there's currently no way to tell whether response from backend contains anything else than session command reply - which aren't counted when BREF_WAITING_RESULT is set and cleared.
This commit is contained in:
VilhoRaatikka
2014-06-12 23:22:51 +03:00
parent e95b6cc0d9
commit 15ff1fd26a
8 changed files with 439 additions and 149 deletions

View File

@ -32,11 +32,17 @@
#include <dcb.h>
typedef enum bref_state {
BREF_NOT_USED,
BREF_IN_USE,
BREF_CLOSED
BREF_NOT_USED = 0x00,
BREF_IN_USE = 0x01,
BREF_WAITING_RESULT = 0x02, /*< for anything that responds */
BREF_CLOSED = 0x08
} bref_state_t;
#define BREF_IS_NOT_USED(s) (s->bref_state & BREF_NOT_USED)
#define BREF_IS_IN_USE(s) (s->bref_state & BREF_IN_USE)
#define BREF_IS_WAITING_RESULT(s) (s->bref_state & BREF_WAITING_RESULT)
#define BREF_IS_CLOSED(s) (s->bref_state & BREF_CLOSED)
typedef enum backend_type_t {
BE_UNDEFINED=-1,
BE_MASTER,