Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7039089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:45:17+00:00 2026-05-28T01:45:17+00:00

May be this is silly on my part but I looked at the source

  • 0

May be this is silly on my part but I looked at the source code for ConcurrentHashMap and I was not able to see the definition of the method lock() anywhere in that class, but I can see this method being invoked at several occasions. In Eclipse , when I say open declaration on lock(), it shows the class ReentrantLock.lock() , so I am confused how this works ? Where is the object reference of the ReentrantLock for the lock() method invocation ?

 V readValueUnderLock(HashEntry<K,V> e) {
        lock(); // where is this method defined in CHM ?
        try {
            return e.value;
        } finally {
            unlock();
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:45:18+00:00Added an answer on May 28, 2026 at 1:45 am

    That code fragment is inside an inner class within ConcurrentHashMap called Segment, which extends ReentrantLock

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a silly question, but I'm not all too experienced with iPhone
This may seem silly, but I'm a bit confused about the following code: public
Okay this may sound silly, but I am not very familiar with XML. What
This may seem like a silly question, but I've looked high and low for
This may be silly, but I'm looking for so-called 'real life' examples of software
This may be silly, but it's been nagging the back of my brain for
This may seem really silly to you, I admit, but when discussing the Model-View-ViewModel
This may be a silly question, but as someone relatively new to PHP, I'm
Now this may seem like a silly question, but I need to know how
This may seem like a silly question but I can't figure it out. let's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.