Skip to content

Commit

Permalink
移动atomic位置。看看对缓存命中有无影响
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Jun 7, 2017
1 parent 06a97a4 commit 813f3ab
Show file tree
Hide file tree
Showing 6 changed files with 688 additions and 686 deletions.
13 changes: 7 additions & 6 deletions include/libcopp/coroutine/coroutine_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ namespace copp {
void *priv_data_;
size_t private_buffer_size_;

#if defined(PROJECT_DISABLE_MT) && PROJECT_DISABLE_MT
util::lock::atomic_int_type<util::lock::unsafe_int_type<int> > status_; /** status **/
#else
util::lock::atomic_int_type<int> status_; /** status **/
#endif

struct jump_src_data_t {
coroutine_context *from_co;
coroutine_context *to_co;
Expand All @@ -83,6 +77,13 @@ namespace copp {
stack_context caller_stack_; /** caller stack context **/
#endif

private:
#if defined(PROJECT_DISABLE_MT) && PROJECT_DISABLE_MT
util::lock::atomic_int_type<util::lock::unsafe_int_type<int> > status_; /** status **/
#else
util::lock::atomic_int_type<int> status_; /** status **/
#endif

protected:
coroutine_context() UTIL_CONFIG_NOEXCEPT;

Expand Down
Loading

0 comments on commit 813f3ab

Please sign in to comment.