Ignore:
Timestamp:
Jul 20, 2010, 8:50:05 AM (10 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: EVFSGUI: Do not run more than 32 smbclient.exe at the same time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-2.0/shared/smbtree.vrs

    r450 r477  
    1313    if BroadCast = 1 then BroadCast = '-b'; else BroadCast = ''
    1414
    15     say '  detach 'samba.!smbtreeexe' 'BroadCast' -S 'debuglevel' 'UserCred' >'samba.!msg
     15    say       '  detach 'samba.!smbtreeexe' 'BroadCast' -S 'debuglevel' 'UserCred' >'samba.!msg
    1616    address cmd 'detach 'samba.!smbtreeexe' 'BroadCast' -S 'debuglevel' 'UserCred' >'samba.!msg
    1717
     
    172172_RefreshShares:
    173173    say time()' _RefreshShares() started'
    174     RefreshID = RANDOM()
     174    /* RefreshID = RANDOM() */
    175175    smbmachine = TempDir||"smbmachine."||machine
     176    MaxSmbClient = 32 /* Do not run more than MaxSmbClient instances of smbclient.exe at the same time */
     177
     178    Defer = 1
     179    do while Defer = 1
     180        SmbCltCount = 0
     181        ok = PRProcessList(proc)
     182
     183        do I = 1 to proc.0
     184            CurProc = VRParseFileName(proc.i.name,'NE')
     185            if CurProc = "SMBCLIENT.EXE" then SmbCltCount = SmbCltCount + 1
     186        end
     187        say '  'SmbCltCount' instance(s) of 'samba.!smbclientexe' is/are running.'
     188        if SmbCltCount >= MaxSmbClient then do
     189            say "  Waiting until at least "SmbCltCount-MaxSmbClient+1" instance(s) of smbclient.exe terminate(s)."
     190            ok = SysSleep(1)
     191        end
     192        else Defer = 0
     193    end
    176194
    177195    if UserCred   = 'USERCRED'   | UserCred = '' | UserCred = '--user=%' then UserCred = '-N'
Note: See TracChangeset for help on using the changeset viewer.