Diff
Not logged in

Differences From Artifact [41511efb9a]:

To Artifact [80b1bf7ba7]:


143
144
145
146
147
148
149




150


151
152
153
154
155
156
157
158




159


160
161
162
163
164
165
166
}

static void
PCondWait(
    pthread_cond_t *pcondPtr,
    PMutex *pmutexPtr)
{




    pthread_cond_wait(pcondPtr, &pmutexPtr->mutex);


}

static void
PCondTimedWait(
    pthread_cond_t *pcondPtr,
    PMutex *pmutexPtr,
    struct timespec *ptime)
{




    pthread_cond_timedwait(pcondPtr, &pmutexPtr->mutex, ptime);


}
#endif /* HAVE_PTHREAD_MUTEX_RECURSIVE */

/*
 * globalLock is used to serialize creation of mutexes, condition variables,
 * and thread local storage. This is the only place that can count on the
 * ability to statically initialize the mutex.







>
>
>
>

>
>








>
>
>
>

>
>







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
}

static void
PCondWait(
    pthread_cond_t *pcondPtr,
    PMutex *pmutexPtr)
{
    int counter = pmutexPtr->counter;

    pmutexPtr->thread = 0;
    pmutexPtr->counter = 0; 
    pthread_cond_wait(pcondPtr, &pmutexPtr->mutex);
    pmutexPtr->thread = pthread_self();
    pmutexPtr->counter = counter;
}

static void
PCondTimedWait(
    pthread_cond_t *pcondPtr,
    PMutex *pmutexPtr,
    struct timespec *ptime)
{
    int counter = pmutexPtr->counter;

    pmutexPtr->thread = 0;
    pmutexPtr->counter = 0; 
    pthread_cond_timedwait(pcondPtr, &pmutexPtr->mutex, ptime);
    pmutexPtr->thread = pthread_self();
    pmutexPtr->counter = counter; 
}
#endif /* HAVE_PTHREAD_MUTEX_RECURSIVE */

/*
 * globalLock is used to serialize creation of mutexes, condition variables,
 * and thread local storage. This is the only place that can count on the
 * ability to statically initialize the mutex.