Skip to content
Permalink
Browse files
MDEV-17441 - InnoDB transition to C++11 atomics
os_thread_count transition to Atomic_counter.
  • Loading branch information
Sergey Vojtovich committed Dec 27, 2018
1 parent e60dc20 commit 8c82ca1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
@@ -73,7 +73,7 @@ typedef unsigned int mysql_pfs_key_t;
#endif /* HAVE_PSI_INTERFACE */

/** Number of threads active. */
extern ulint os_thread_count;
extern Atomic_counter<ulint> os_thread_count;

/***************************************************************//**
Compares two thread ids for equality.
@@ -28,7 +28,7 @@ Created 9/8/1995 Heikki Tuuri
#include "srv0srv.h"

/** Number of threads active. */
ulint os_thread_count;
Atomic_counter<ulint> os_thread_count;

/***************************************************************//**
Compares two thread ids for equality.
@@ -118,7 +118,7 @@ os_thread_create_func(

CloseHandle(handle);

my_atomic_addlint(&os_thread_count, 1);
os_thread_count++;

return((os_thread_t)new_thread_id);
#else /* _WIN32 else */
@@ -127,7 +127,7 @@ os_thread_create_func(

pthread_attr_init(&attr);

my_atomic_addlint(&os_thread_count, 1);
os_thread_count++;

int ret = pthread_create(&new_thread_id, &attr, func, arg);

@@ -182,7 +182,7 @@ os_thread_exit(bool detach)
pfs_delete_thread();
#endif

my_atomic_addlint(&os_thread_count, ulint(-1));
os_thread_count--;

#ifdef _WIN32
ExitThread(0);

0 comments on commit 8c82ca1

Please sign in to comment.