[haiku-bugs] Re: [Haiku] #11563: HaikuDepot should have an advanced tab while opening package files directly

  • From: "stippi" <trac@xxxxxxxxxxxx>
  • Date: Tue, 03 Feb 2015 20:56:11 -0000

#11563: HaikuDepot should have an advanced tab while opening package files 
directly
---------------------------------------+----------------------------
   Reporter:  kallisti5                |      Owner:  stippi
       Type:  enhancement              |     Status:  new
   Priority:  normal                   |  Milestone:  R1
  Component:  Applications/HaikuDepot  |    Version:  R1/Development
 Resolution:                           |   Keywords:
 Blocked By:                           |   Blocking:
Has a Patch:  0                        |   Platform:  All
---------------------------------------+----------------------------

Comment (by stippi):

 The problem should be this: You've removed the call to
 `_InitContentPopulator();` from the `PackageContentsView` constructor. And
 in `SetPackage()`, instead of this code block:

 {{{
     if (fPackage == package)
         return;
 //  printf("PackageContentsView::SetPackage(%s)\n",
 //      package.Get() != NULL ? package->Title().String() : "NULL");

     Clear();
     {
         BAutolock lock(&fPackageLock);
         fPackage = package;
     }
     release_sem_etc(fContentPopulatorSem, 1, 0);
 }}}

 ... you are now doing this:

 {{{
     fPackage = package;
     printf("\nPackage set to %s\n", (fPackage->Title()).String());

     printf("Initializing population\n");
     _InitContentPopulator();
 }}}

 This is completely different. You need to restore the original code. The
 call to `release_sem_etc(fContentPopulatorSem, 1, 0);` is what makes the
 content thread start to run. And the way the locking happens is also
 important. The way you changed the code, a new content populator thread is
 created for each package that is supposed to show. The original code
 created only one thread. And the thread is then never put to work. The
 original design creates only one thread and starts and stops it on demand.

--
Ticket URL: <https://dev.haiku-os.org/ticket/11563#comment:19>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: