Lines Matching defs:mp

90 isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) {
93 err = pthread_mutex_init(&mp->mutex, NULL);
113 mp->stats = &stats[stats_next++];
117 mp->stats->file = file;
118 mp->stats->line = line;
119 mp->stats->count = 0;
120 timevalclear(&mp->stats->locked_total);
121 timevalclear(&mp->stats->wait_total);
123 mp->stats->lockers[i].file = NULL;
124 mp->stats->lockers[i].line = 0;
125 mp->stats->lockers[i].count = 0;
126 timevalclear(&mp->stats->lockers[i].locked_total);
127 timevalclear(&mp->stats->lockers[i].wait_total);
134 isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) {
142 if (pthread_mutex_lock(&mp->mutex) != 0)
146 mp->stats->lock_t = postlock_t;
150 mp->stats->count++;
151 timevaladd(&mp->stats->wait_total, &postlock_t);
154 if (mp->stats->lockers[i].file == NULL) {
155 locker = &mp->stats->lockers[i];
159 } else if (mp->stats->lockers[i].file == file &&
160 mp->stats->lockers[i].line == line) {
161 locker = &mp->stats->lockers[i];
171 mp->stats->cur_locker = locker;
177 isc_mutex_unlock_profile(isc_mutex_t *mp, const char *file, int line) {
183 if (mp->stats->cur_locker != NULL) {
185 timevalsub(&unlock_t, &mp->stats->lock_t);
186 timevaladd(&mp->stats->locked_total, &unlock_t);
187 timevaladd(&mp->stats->cur_locker->locked_total, &unlock_t);
188 mp->stats->cur_locker = NULL;
191 return ((pthread_mutex_unlock((&mp->mutex)) == 0) ? \
229 isc_mutex_init_errcheck(isc_mutex_t *mp)
242 err = pthread_mutex_init(mp, &attr) != 0)
259 isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line) {
264 err = pthread_mutex_init(mp, ISC__MUTEX_ATTRS);