diff options
| author | Tyge Løvset <[email protected]> | 2021-12-02 16:40:23 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-02 16:40:23 +0100 |
| commit | 9cd20ebfc4f1e10153ff814085499223265ef902 (patch) | |
| tree | 13abd2d95ab748f5c06a9c61dc1a8f200a341a2e /examples/sptr_pthread.c | |
| parent | d8588e42dd180b51c6ca8861a426cf4db21c7084 (diff) | |
| download | STC-modified-9cd20ebfc4f1e10153ff814085499223265ef902.tar.gz STC-modified-9cd20ebfc4f1e10153ff814085499223265ef902.zip | |
shared_ptr atomic count: Using stdatomics.h for other compilers than gcc, clang or msvc.
Diffstat (limited to 'examples/sptr_pthread.c')
| -rw-r--r-- | examples/sptr_pthread.c | 2 |
1 files changed, 1 insertions, 1 deletions
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"
|
