summaryrefslogtreecommitdiff
path: root/src/hos_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hos_common.h')
-rw-r--r--src/hos_common.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/hos_common.h b/src/hos_common.h
index fdc7c654..b6583053 100644
--- a/src/hos_common.h
+++ b/src/hos_common.h
@@ -13,10 +13,12 @@
#define atomic_add(x,y) __sync_add_and_fetch((x),(y))
#define atomic_read(x) __sync_add_and_fetch((x),0)
#define atomic_sub(x,y) __sync_sub_and_fetch((x),(y))
+#define atomic_set(x,y) __sync_lock_test_and_set((x),(y))
#else
#define atomic_add(x,y) ((*(x))+=(y))
#define atomic_read(x) (*(x))
#define atomic_sub(x,y) ((*(x))-=(y))
+#define atomic_set(x,y) (*(x)=(y))
#endif
#define MAX_HOS_STRING_LEN 1024
@@ -24,6 +26,17 @@
#define MAX_HOS_CLIENT_FD_NUM 65535
#define HOS_LOG_PATH "./tsglog/hoslog"
+/*hos instance */
+typedef struct hos_instance_s{
+#define INSTANCE_UNINIT_STATE 0
+#define INSTANCE_ATTEMPT_STATE 1
+#define INSTANCE_ENABLE_STATE 2
+ int status;
+ int error_code;
+ char error_message[1024];
+ const char *hos_url_prefix;
+}* hos_instance;
+
typedef struct data_info_s
{
size_t *tx_pkts;
@@ -70,6 +83,7 @@ typedef struct hos_config_s
uint32_t cache_count;
uint32_t max_request_num;
uint32_t max_request_context;
+ uint32_t reconnection_time;
}hos_config_t;
typedef struct hos_func_thread_s
@@ -81,6 +95,8 @@ typedef struct hos_func_thread_s
fs2_info_t fs2_info;
pthread_t fs2_thread;
int fs2_status;
+ pthread_t hos_client_retry_thread_id;
+ int hos_client_retry_thread_status;
#define HOS_FS2_START 1
#define HOS_FS2_STOP 2
}hos_func_thread_t;