Пример #1
0
PKIX_Error *
PKIX_PL_AcquireReaderLock(
        PKIX_PL_RWLock *lock,
        void *plContext)
{
        PKIX_ENTER(RWLOCK, "PKIX_PL_AcquireReaderLock");
        PKIX_NULLCHECK_ONE(lock);

        PKIX_RWLOCK_DEBUG("\tCalling PR_RWLock_Rlock)\n");
        (void) PR_RWLock_Rlock(lock->lock);

        lock->readCount++;

        PKIX_RETURN(RWLOCK);
}
Пример #2
0
const char *CSFCurrentThreadName() {
  const char *name = nullptr;
#ifdef WIN32
  thread_key_t key = GetCurrentThreadId();
#else
  thread_key_t key = pthread_self();
#endif
  PR_RWLock_Rlock(maplock);
  threadMap_t::iterator i = threadMap.find(key);
  if (i != threadMap.end()) {
    name = i->second->name;
  }
  PR_RWLock_Unlock(maplock);
  return name;
}