Lines Matching +full:11 +full:mp
99 isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) { in isc_mutex_init_profile() argument
102 err = pthread_mutex_init(&mp->mutex, NULL); in isc_mutex_init_profile()
122 mp->stats = &stats[stats_next++]; in isc_mutex_init_profile()
126 mp->stats->file = file; in isc_mutex_init_profile()
127 mp->stats->line = line; in isc_mutex_init_profile()
128 mp->stats->count = 0; in isc_mutex_init_profile()
129 timevalclear(&mp->stats->locked_total); in isc_mutex_init_profile()
130 timevalclear(&mp->stats->wait_total); in isc_mutex_init_profile()
132 mp->stats->lockers[i].file = NULL; in isc_mutex_init_profile()
133 mp->stats->lockers[i].line = 0; in isc_mutex_init_profile()
134 mp->stats->lockers[i].count = 0; in isc_mutex_init_profile()
135 timevalclear(&mp->stats->lockers[i].locked_total); in isc_mutex_init_profile()
136 timevalclear(&mp->stats->lockers[i].wait_total); in isc_mutex_init_profile()
143 isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) { in isc_mutex_lock_profile() argument
151 if (pthread_mutex_lock(&mp->mutex) != 0) in isc_mutex_lock_profile()
155 mp->stats->lock_t = postlock_t; in isc_mutex_lock_profile()
159 mp->stats->count++; in isc_mutex_lock_profile()
160 timevaladd(&mp->stats->wait_total, &postlock_t); in isc_mutex_lock_profile()
163 if (mp->stats->lockers[i].file == NULL) { in isc_mutex_lock_profile()
164 locker = &mp->stats->lockers[i]; in isc_mutex_lock_profile()
168 } else if (mp->stats->lockers[i].file == file && in isc_mutex_lock_profile()
169 mp->stats->lockers[i].line == line) { in isc_mutex_lock_profile()
170 locker = &mp->stats->lockers[i]; in isc_mutex_lock_profile()
180 mp->stats->cur_locker = locker; in isc_mutex_lock_profile()
186 isc_mutex_unlock_profile(isc_mutex_t *mp, const char *file, int line) { in isc_mutex_unlock_profile() argument
192 if (mp->stats->cur_locker != NULL) { in isc_mutex_unlock_profile()
194 timevalsub(&unlock_t, &mp->stats->lock_t); in isc_mutex_unlock_profile()
195 timevaladd(&mp->stats->locked_total, &unlock_t); in isc_mutex_unlock_profile()
196 timevaladd(&mp->stats->cur_locker->locked_total, &unlock_t); in isc_mutex_unlock_profile()
197 mp->stats->cur_locker = NULL; in isc_mutex_unlock_profile()
200 return ((pthread_mutex_unlock((&mp->mutex)) == 0) ? \ in isc_mutex_unlock_profile()
223 fprintf(fp, " %-11s %4d: %10u %lu.%06lu %lu.%06lu %5d\n", in isc_mutex_statsprofile()
238 isc_mutex_init_errcheck(isc_mutex_t *mp) in isc_mutex_init_errcheck() argument
251 err = pthread_mutex_init(mp, &attr) != 0) in isc_mutex_init_errcheck()
268 isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line) { in isc__mutex_init() argument
273 err = pthread_mutex_init(mp, ISC__MUTEX_ATTRS); in isc__mutex_init()