Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

thgtaskbar: allow different users to run an instance

the double-run check was too restrictive, disallowing
different users to run their own instance.

Changeset e13dc53bd273

Parent 89ab272e78cb

by Adrian Buehlmann

Changes to one file · Browse files at e13dc53bd273 Showing diff from parent 89ab272e78cb Diff from another changeset...

Change 1 of 1 Show Entire File thgtaskbar.py Stacked
 
421
422
423
424
 
 
425
426
427
428
429
 
 
430
431
432
433
434
 
 
435
436
437
 
421
422
423
 
424
425
426
427
428
 
 
429
430
431
432
433
434
 
435
436
437
438
439
@@ -421,17 +421,19 @@
  # Clean up when we exit   self.SvcStop()   -MUTEXNAME = 'thgtaskbar' +INSTALLMUTEXNAME = 'thgtaskbar' +RUNMUTEXNAME = 'thgtaskbar-' + GetUserName()    def main():   sa = win32security.SECURITY_ATTRIBUTES() - sa.SetSecurityDescriptorDacl (1, None, 0) # allow full access - mutex1 = win32event.CreateMutex(sa, 1, MUTEXNAME) + sa.SetSecurityDescriptorDacl(1, None, 0) # allow full access + runmutex = win32event.CreateMutex(sa, 1, RUNMUTEXNAME)   if GetLastError() == winerror.ERROR_ALREADY_EXISTS:   print "another instance is already running"   return   # see http://www.jrsoftware.org/iskb.php?mutexsessions - mutex2 = win32event.CreateMutex(sa, 1, 'Global\\' + MUTEXNAME) + installmutex1 = win32event.CreateMutex(sa, 1, INSTALLMUTEXNAME) + installmutex2 = win32event.CreateMutex(sa, 1, 'Global\\' + INSTALLMUTEXNAME)   w=MainWindow()   PumpMessages()