From 9cd20ebfc4f1e10153ff814085499223265ef902 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 2 Dec 2021 16:40:23 +0100 Subject: shared_ptr atomic count: Using stdatomics.h for other compilers than gcc, clang or msvc. --- examples/sptr_pthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/sptr_pthread.c b/examples/sptr_pthread.c index cffafd3d..0a1b7c79 100644 --- a/examples/sptr_pthread.c +++ b/examples/sptr_pthread.c @@ -20,8 +20,8 @@ void Base_del(Base* b) { printf("Base::~Base()\n"); } void* thr(csptr_base* lp) { - static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; sleep(1); + static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; c_autoscope (pthread_mutex_lock(&mtx), pthread_mutex_unlock(&mtx)) { printf("local pointer in a thread:\n" -- cgit v1.2.3