![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | returning to calle from a critical region There is a remote method that returns a datatable to the client. I a talking of a scenario when there are multiple requests which invoke the same method. I have a synchronized region of code. By that I mean only one thread/request should execute that code; others should wait. I've written simply with a lock. My doubt is that I am doing a return within that region. Will this release the lock on the synchronized region? lock(Handle) { //some fetching logic here //returning datatable return myDataTableObj; } --deostroll |
My System Specs![]() |
| | #2 (permalink) |
| | Re: returning to calle from a critical region Definetely, it will release the lock. Lock is defined as try { } finally { } block, so, the lock is always released in finally section. Cheers, pennanth On Sat, 13 Jun 2009 00:01:29 +1000, deostroll <deostroll@xxxxxx> wrote: Quote: > There is a remote method that returns a datatable to the client. I a > talking of a scenario when there are multiple requests which invoke > the same method. I have a synchronized region of code. By that I mean > only one thread/request should execute that code; others should wait. > I've written simply with a lock. My doubt is that I am doing a return > within that region. Will this release the lock on the synchronized > region? > > lock(Handle) > { > //some fetching logic here > > //returning datatable > return myDataTableObj; > } > > > --deostroll -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ |
My System Specs![]() |
| | #3 (permalink) |
| | Re: returning to calle from a critical region On Jun 13, 11:41*am, pennanth <penna...@xxxxxx> wrote: Quote: > Definetely, it will release the lock. > > Lock is defined as try { } finally { } block, so, the lock is always * > released in finally section. > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| DVD Region Incorrect | Vista General | |||
| Blu ray region code. | Media Center | |||
| dvd region problems | Vista hardware & devices | |||
| No DVD Region Tab | Vista hardware & devices | |||