Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

clientlet: remove class clientlet, add new class thread_access_checker #121

Merged
merged 2 commits into from Jul 12, 2018

Conversation

shengofsun
Copy link
Contributor

@shengofsun shengofsun commented Jul 9, 2018

Removing class clientlet & file "clientlet.h" coz it's hard to describe what "clientlet" is when writing documents or comments.
So the "clientlet.h" is seperated into two modules:

  1. async_calls.h, which contains the async call functions for task, rpc and disk io.
  2. thread_access_checker, a utility function used to check if some code is visited within one thread.

Conflicts:
	include/dsn/cpp/serverlet.h
	include/dsn/service_api_cpp.h
	include/dsn/tool/cli/cli.client.h
	src/core/tests/async_call.cpp
	src/core/tests/rpc.cpp
	src/dist/replication/lib/replica.h
	src/dist/replication/lib/replica_chkpt.cpp
	src/dist/replication/lib/replica_stub.cpp
	src/dist/replication/zookeeper/lock_types.h
#include <cstdlib>
#include <sys/stat.h>
#include <dsn/utility/filesystem.h>
#include <dsn/tool-api/async_calls.h>

#include "nfs_server_impl.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <dsn/service_api_cpp.h>
#include <dsn/cpp/clientlet.h>

#include <gtest/gtest.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些顺序要按照google cpp style来吗?

EXPECT_TRUE(t != nullptr);
t->wait();
EXPECT_TRUE(cl->str == "after called");
delete cl;
EXPECT_TRUE(tc->str == "after called");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改到这里了,就把EXPECT_TRUE改成EXPECT_EQ/NE吧,这个文件里的其他几处也是
还有为什么不是ASSERT_*呢?

#include "test_utils.h"

DEFINE_TASK_CODE(LPC_TEST_CLIENTLET, TASK_PRIORITY_COMMON, THREAD_POOL_TEST_SERVER)
using namespace dsn;

int global_value;
class test_clientlet : public clientlet
class tracker_class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

叫xxxclass,感觉不太好啊

@shengofsun shengofsun merged commit 3125d11 into XiaoMi:master Jul 12, 2018
@qinzuoyan qinzuoyan mentioned this pull request Aug 20, 2018
28 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants