File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ int createEventfd()
51
51
}
52
52
const int kPollTimeMs = 10000 ;
53
53
#endif
54
- __thread EventLoop *t_loopInThisThread = 0 ;
54
+ __thread EventLoop *t_loopInThisThread = nullptr ;
55
55
56
56
EventLoop::EventLoop ()
57
57
: _looping(false ),
@@ -98,7 +98,7 @@ void EventLoop::resetAfterFork()
98
98
EventLoop::~EventLoop ()
99
99
{
100
100
assert (!_looping);
101
- t_loopInThisThread = NULL ;
101
+ t_loopInThisThread = nullptr ;
102
102
#ifdef __linux__
103
103
close (_wakeupFd);
104
104
#else
Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ class EventLoop : NonCopyable
71
71
void queueInLoop (Func &&f);
72
72
void wakeup ();
73
73
void wakeupRead ();
74
+ size_t index ()
75
+ {
76
+ return _index;
77
+ }
78
+ void setIndex (size_t index)
79
+ {
80
+ _index = index;
81
+ }
74
82
// template <typename T>
75
83
// const std::shared_ptr<ObjectPool<T>> &getObjectPool()
76
84
// {
@@ -169,6 +177,7 @@ class EventLoop : NonCopyable
169
177
std::unique_ptr<Channel> _wakeupChannelPtr;
170
178
171
179
void doRunInLoopFuncs ();
180
+ size_t _index = -1 ;
172
181
};
173
182
174
183
} // namespace trantor
You can’t perform that action at this time.
0 commit comments