91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
pmutexPtr->counter = 0;
}
static void
PMutexDestroy(
PMutex *pmutexPtr)
{
#if defined(HAVE_PTHREAD_SPIN_LOCK) && !defined(HAVE_STDATOMIC_H)
pthread_spin_destroy(&pmutexPtr->lock);
#endif
pthread_mutex_destroy(&pmutexPtr->mutex);
}
#ifdef HAVE_STDATOMIC_H
static void
|
>
>
>
>
>
>
>
>
|
>
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
pmutexPtr->counter = 0;
}
static void
PMutexDestroy(
PMutex *pmutexPtr)
{
#ifdef HAVE_STDATOMIC_H
if (__atomic_load_n(&pmutexPtr->thread, __ATOMIC_SEQ_CST) != 0) {
Tcl_Panic("mutex still owned");
}
#else
if (mutexPtr->thread != 0) {
Tcl_Panic("mutex still owned");
}
# if defined(HAVE_PTHREAD_SPIN_LOCK)
pthread_spin_destroy(&pmutexPtr->lock);
# endif
#endif
pthread_mutex_destroy(&pmutexPtr->mutex);
}
#ifdef HAVE_STDATOMIC_H
static void
|