Daniel Rychlik wrote:
> One of issues that I am having is when the thread enters into
> getAvailableResource routine its not seeing that the
> $Resources{'WAN1'}->{INUSE} = 1; has been made unavailable.

The problem is that you are doing 'share()' on %Resources after
populating
it.  This causes the data you put into %Resources to be lost.  See
http://annocpan.org/~NWCLARK/perl-5.8.7/ext/threads/shared/shared.pm#note_395
for details.

As such, you should change your code from:

    # Runtime Resource handling
    our %Resources;

    # WAN Resources
    $Resources{'WAN1'} = {'DRIVE' => 'O:', 'INUSE' => 0};
    ...

    share(%Resources);

to:

    # Runtime Resource handling
    our %Resources :shared;

    # WAN Resources
    $Resources{'WAN1'} = {'DRIVE' => 'O:', 'INUSE' => 0};
    ...

Reply via email to