-
Notifications
You must be signed in to change notification settings - Fork 59
Conversation
include/dsn/tool-api/zlocks.h
Outdated
*/ | ||
class zlock | ||
class ilock; | ||
class zlock : private boost::noncopyable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
显式定义 noncopyable 吧也没两行代码,其实有些版本的 boost/noncopyable.hpp 会引入 boost/config.hpp,挺大的一个头文件依赖,我以前也用这个,后来就不用了
public:
// disallow copy and assign
zlock(const zlock &) = delete;
zlock &operator=(const zlock &) = delete;
@neverchanje 把boost的依赖删了 |
include/dsn/utility/macros.h
Outdated
#ifndef MACROS_H | ||
#define MACROS_H | ||
|
||
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个直接放在unitity/ports.h文件中就好了,就不用单独增加一个macros.h文件了。
就像 GTEST_DISALLOW_COPY_AND_ASSIGN_ 宏也是放在 gtest-port.h 中一样。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是这个理没错
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主要是人家的DISALLOW_COPY_AND_ASSIGN都是portable的,我们这个不是portable的……
再说,也有其他项目port和非port的宏分开啊。
anyway, 我挪过去吧
the disallow copy thing has fixed. @qinzuoyan @neverchanje |
the lock related code was scattered in different place:
now place them together, do some small modification and add some comments.