Chris Hemsworth feared for his life when he visited a prison.

The 31-year-old actor wanted to find out what life was like behind bars as part of his research for his role in 'Blackhat' - in which he plays a hacker who gets broken out of prison - but he admits he had second thoughts when he arrived at the correctional facility.

He recalled: ''[We] got to the prison and I just felt all of a sudden, 'What am I doing here? My hair is [standing] on the back of my neck.

''And the warden says to us, 'OK, look this is at your own risk. Let me tell you, all they do is think about ways to kill people, so, just so you know.'

''[I was like,] 'What are we doing here then?' ''

Chris - who has children India, two, and nine-month-old twins Sasha and Tristan with wife Elsa Pataky - was relieved to find he got off quite lightly with the inmates thanks to one of his most famous roles.

He told 'Access Hollywood': ''I didn't even think about the Thor thing. Straight away, a lot of them had seen 'Thor,' and it was like 'Oh, Thor's in here.'

''They start heckling as I start walking down between the prison cells. And it was like, 'I've just been heckled!'

''And it wasn't abusive necessarily, it was slightly threatening.''

Despite his fear, Chris found the trip worthwhile for his research.

He added:''Man, different world! And so for me, with the character, it just highlighted [that] you go in to prison as one person, you come out a completely different person, as did my character.

''That was so beneficial kind of seeing that. And it's a whole other language.''