提交 01644a39 编写于 作者: O obdev 提交者: ob-robot

optimize the lock in ObObjectDevice

上级 49809d21
......@@ -256,7 +256,6 @@ int ObObjectDevice::release_res(void* ctx, const ObIOFd &fd, ObStorageAccessType
int ret = OB_SUCCESS;
int ret_tmp = OB_SUCCESS;
/*release the ctx*/
common::ObSpinLockGuard guard(lock_);
if (OB_ISNULL(ctx)) {
ret = OB_INVALID_ARGUMENT;
OB_LOG(WARN, "ctx is null, invald para!");
......@@ -304,7 +303,6 @@ int ObObjectDevice::open(const char *pathname, const int flags, const mode_t mod
int ret = OB_SUCCESS;
void* ctx = NULL;
ObStorageAccessType access_type = OB_STORAGE_ACCESS_MAX_TYPE;
common::ObSpinLockGuard guard(lock_);
//validate fd
if (fd_mng_.validate_fd(fd, false)) {
ret = OB_INIT_TWICE;
......
......@@ -90,9 +90,9 @@ private:
ObStorageUtil util_;
/*obj ctx pool: use to create fd ctx(reader/writer)*/
common::ObPooledAllocator<ObStorageReader> reader_ctx_pool_;
common::ObPooledAllocator<ObStorageAppender> appender_ctx_pool_;
common::ObPooledAllocator<ObStorageWriter> overwriter_ctx_pool_;
common::ObPooledAllocator<ObStorageReader, ObMalloc, ObSpinLock> reader_ctx_pool_;
common::ObPooledAllocator<ObStorageAppender, ObMalloc, ObSpinLock> appender_ctx_pool_;
common::ObPooledAllocator<ObStorageWriter, ObMalloc, ObSpinLock> overwriter_ctx_pool_;
void* base_info_;
bool is_started_;
char storage_info_[OB_MAX_URI_LENGTH];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册