diff options
| author | pengxuanzheng <[email protected]> | 2020-09-23 19:06:09 +0800 |
|---|---|---|
| committer | pengxuanzheng <[email protected]> | 2020-11-02 18:59:51 +0800 |
| commit | b3e7de2b213931626a3c856355d44bb112b83274 (patch) | |
| tree | e2bfa4b7bbaa4e45d12dc9f6f7880ee7c8a3403e /src/hos_hash.cpp | |
| parent | 10e17cb043eb408b726aa51c51c092674e5db4a1 (diff) | |
线程池支持
Diffstat (limited to 'src/hos_hash.cpp')
| -rw-r--r-- | src/hos_hash.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/hos_hash.cpp b/src/hos_hash.cpp index 5bbc7b5b..592f041b 100644 --- a/src/hos_hash.cpp +++ b/src/hos_hash.cpp @@ -17,6 +17,8 @@ void add_hos_info(hos_info_t **handle, hos_info_t *input) } else { + value->mode = input->mode; + value->handle = input->handle; value->bucket = input->bucket; value->object = input->object; value->callback = input->callback; @@ -31,22 +33,22 @@ hos_info_t *find_info_by_fd(hos_info_t *handle, size_t fd) return value; } -void delete_info_by_fd(hos_info_t *handle, size_t fd) +void delete_info_by_fd(hos_info_t **handle, size_t fd) { hos_info_t *value = NULL; - HASH_FIND_INT(handle, &fd, value); + HASH_FIND_INT(*handle, &fd, value); if (value) { - HASH_DEL(handle, value); + HASH_DEL(*handle, value); free(value); } } -void delete_all(hos_info_t *handle) +void delete_all(hos_info_t **handle) { hos_info_t *current, *tmp; - HASH_ITER(hh, handle, current, tmp) + HASH_ITER(hh, *handle, current, tmp) { - HASH_DEL(handle, current); + HASH_DEL(*handle, current); } } |
